Conversation
Adds a dedicated unit test for web/lib/base64.ts, which was previously uncovered (no base64 test file) despite sitting on the auth and transaction path (signatures, serialized base64 transactions, account data). Covered behavior: - empty -> empty encoding - known-value roundtrips (including 0x00/0xff/0x80) - encode output byte-identical to the Buffer reference across many lengths - roundtrips across the 0x8000 String.fromCharCode chunk boundary (the chunkSize constant keeps btoa spreads under the argument limit) - btoa and Buffer fallback branches agree Verified locally: - npm test --workspace @agentvouch/web -- base64 (5 passed) - full web suite: 142 files / 1187 tests passed - format:check, typecheck, lint:web all pass
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds direct behavioral test coverage for
buildSecurityScanFromFields(
web/lib/securityScan.ts), the DB-row → user-facing security-verdicttransformer. The existing
scan.test.tscovers the AI-side scanner(
scanSkillTree/ensureSkillScan/runScanSafe), andtrustSignals.test.tsonly imports theSkillSecurityScantype —there was no test exercising how a stored
SkillScanFieldRowisnormalized, and how corrupt or unknown values are rejected.
Behavior locked in
reviewrow yields a fully normalizedSkillSecurityScan. Verdicts outside the allowed set (undefined,null,"",safe,allow,ok,SAFE,pass) — i.e. anythingthe scanner contractually never returns — yield
null, so a corrupt orunknown stored verdict cannot leak a bogus verdict into the rendered UI.
low|medium|highrisks are kept; unknown ormissing risk collapses to
null.category/evidence/filedefault to
unknown/""/SKILL.md.insertScanpersists viaJSON.stringify(scan.findings)) are parsed; non-array JSON, malformedJSON, and non-string/non-array values yield an empty
findings[].severityare filtered out.truncatedcoerces viaBoolean;scanned_atserializes a
Dateto an ISO string and nulls tonullwhen missing;model/rubric_version/scan_source/generated_by_modelapply theirdocumented defaults;
advisoryis alwaystrue.Verification
npm test --workspace @agentvouch/web -- --maxWorkers=1 --no-fileParallelism— pass: 143 files, 1203 tests.
npm run format:check— pass (all matched files use Prettier style).npm run lint:web— pass.npm run typecheck --workspace @agentvouch/web(next typegen && tsc --noEmit) — pass.0 source edits) and the CI test job covers typecheck/lint/format/vitest.
The Vercel build gate is the real web build gate per repo convention.
Scope
Exactly one new file,
web/__tests__/lib/securityScan.test.ts, no changesto
web/lib/securityScan.tsor any other source. No in-flight PR touchesthis file.
Signing
This headless cron run has no GPG signing key configured (
git config user.signingkeyempty). Per the established cron precedent, the commit isunsigned; to sign-amend and re-push: