Skip to content

fix(context): quoted secret assignments + fail-closed revision/body (#62) - #116

Merged
huiyu merged 1 commit into
3.0from
fix/62-quoted-secrets-and-failclosed
Aug 26, 2026
Merged

fix(context): quoted secret assignments + fail-closed revision/body (#62)#116
huiyu merged 1 commit into
3.0from
fix/62-quoted-secrets-and-failclosed

Conversation

@huiyu

@huiyu huiyu commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Campaign-10 fix #1 — the 3 gaps the concentrated review found (1 blocker, 1 important split in two).

  • Quoted secret assignments (BLOCKER): token="secret", JSON "token": "secret", dotenv/shell export TOKEN="…" all returned safe — the value char class excluded quotes and the separator had to abut the key. SENSITIVE_ASSIGNMENT now allows an optional quote around the key and the value.
  • Pathological revision (IMPORTANT): a 400-digit revision passed the unbounded /^[1-9]\d*$/, parsed to Infinity, and serialized to null. Revision/issue digits are now bounded (≤9) → malformed (fail closed).
  • Non-string body (IMPORTANT): was coerced to "" in replaceManagedRevision and the CLI's ?? "", so the CLI exited 0 and silently discarded the input. A non-string body now throws invalid-managed-body (non-zero CLI exit); null/undefined still mean a fresh create.

Verification

test:project-context: 75/75 — five quoted/dotenv/JSON secret shapes, a 400-digit revision → malformed, non-string bodies → throw (function + CLI). Adapters regenerated.

🤖 Generated with Claude Code

…vision/body (#62)

Concentrated-review pass on the two most-reopened surfaces found three more gaps:

- quoted secret assignments bypassed the raw-string screen: token="secret",
  JSON "token": "secret", dotenv/shell export TOKEN="…" all returned safe because
  the value char class excluded quotes and the separator had to abut the key.
  SENSITIVE_ASSIGNMENT now allows an optional quote around the key and the value.
- a pathological revision (e.g. 400 digits) passed the unbounded /^[1-9]\d*$/
  regex, parsed to Infinity, and serialized to null. Revision and issue digits are
  now bounded (<=9), so such a header is malformed — fail closed.
- a non-string body was coerced to "" in replaceManagedRevision (and the CLI's
  `?? ""`), so the CLI exited 0 and silently discarded the original input. A
  non-string body now throws invalid-managed-body; null/undefined still mean a
  fresh create. The CLI passes body through so the error surfaces (non-zero exit).

Reverse tests: five quoted/dotenv/JSON secret shapes; a 400-digit revision →
malformed; non-string bodies → throw (function + CLI). Adapters regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwyFyRC6pepaK6DuMK7YeT
@huiyu
huiyu merged commit fad739d into 3.0 Aug 26, 2026
1 check passed
@huiyu
huiyu deleted the fix/62-quoted-secrets-and-failclosed branch August 26, 2026 06:17
huiyu added a commit that referenced this pull request Aug 26, 2026
…n (campaign 10, #116)

The concentrated review found 3 more gaps on the two most-reopened files (quoted
secret assignments, 400-digit revision -> Infinity/null, non-string body coerced
to empty). All fixed in #116. 43/43 threads resolved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwyFyRC6pepaK6DuMK7YeT
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