Skip to content

chore: fix codebase audit findings - #144

Closed
prdai wants to merge 9 commits into
mainfrom
chore/codebase-audit
Closed

prdai wants to merge 9 commits into
mainfrom
chore/codebase-audit

Conversation

@prdai

@prdai prdai commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

what changed

  • Fix confirmed bugs:
    • The secure product-trends-node sample crashed at startup (ESM package.json with require).
    • sce-unit panicked on a nonce of the wrong length.
    • A failed JWKS fetch stayed cached in packages/common/src/jwt.ts.
    • registry-service make run was missing DYNAMO_TABLE.
  • Services:
    • Move duplicated helpers into packages/common: jsonResponse, cursor, CSV, throttle retry, algorithm id check.
    • Remove the dead RecordCount path and unused dependencies, knip ignores, exports and the verifier UpdateItem grant.
  • Behavior changes:
    • Telemetry stores origin: "service" for control-plane events.
    • PDM /count and /records return 404 for a missing algorithm table.
    • The rads result-consumer sends malformed messages to the DLQ, the same as secure.
    • Secure log-service requires the verifier JWKS env vars instead of failing open.
    • subjectAccessAll returns 400 only for a bad cursor.
  • Benchmark: secure-rads result_delivery now starts at dc-app-completed, the same as rads. phase-timings.csv was recomputed offline from the committed timestamps.
  • Seeding: the DEK cache file is now written with mode 0600, and @smithy/node-http-handler is declared.
  • CI: now builds and vets registry-service, host-tools and kms-service. Go uses the version from each module's go.mod, and both portals are built.
  • Docs:
    • The e2e flows and cost-service.md now describe PDM /count, launch-failed and the subject-access steps.
    • Fix the SSM signing-key path, the cert list and the derive-env overwrite behavior.
    • Add the rads make targets.
    • Add a "Known limitations" section to README.md.

why

An audit of the whole repo found bugs, drift between code and docs, CI gaps, unused code, and helpers copied between rads/ and secure/. The open endpoints and the other security hardening items are accepted as PoC scope. They are listed under "Known limitations" and not changed.

verification

  • bunx tsc --noEmit, bunx biome check src, bunx knip and bun install --frozen-lockfile pass in packages/common and all 15 TS services. One exception: knip in secure/verifier-service reports CHALLENGE_TTL_SECONDS and RegisteredPcrs, which were already unused before this change.
  • go build ./... && go vet ./... pass in packages/go-common, secure/sce-unit, secure/csav/registry-service and rads/sce/execution-service/host-tools. go mod tidy -diff reports no changes in all 6 Go modules.
  • node main.js on the fixed sample exits 0 with the expected output. cargo check --offline passes for the rust sample.
  • bun run build passes in both portals.
  • uvx ruff check and ruff format --check pass in benchmark/. markdownlint passes on the docs. actionlint shows only the existing unknown-label warnings for the blacksmith-* runners.
  • Not verified: nothing was deployed or run against AWS. No service has tests. The CI changes have not run on GitHub yet.

notes

A partial subject-access ingest still cannot be retried, because a repeat ingest gets a 409. The comment now describes that, but the behavior is unchanged.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

prdai and others added 9 commits November 29, 2026 22:03
Co-authored-by: Claude <noreply@anthropic.com>
…ckages/common

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
…s deps

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant