docs: audit seq emit invariant + counter install order (post-#173/#174)#178
Merged
Conversation
Reflects PRs #173 and #174 (both merged to main) in the canonical audit doc and the comprehensive knowledge skill. docs/security/audit-logging.md — under "Sequence numbers", added: - Counter installation order — the SequenceCounter is installed by installSequenceCounterMiddleware (wraps the auth chain) so auth_verify / auth_fail land seq=1; the runner's request entry uses EnsureSequenceCounter to reuse the wrapper-installed counter and only allocate fresh on the --no-auth path. Pinned by TestAuthAudit_SeqStampedWhenCounterInstalled + TestEnsureSequenceCounter_ReusesExisting. - Emit invariant — per-invocation events MUST emit via EmitFromContext (or a typed helper); plain Emit skips the counter and the trace cross-link. The regression behind #173 (tool_exec + session_end) and #174 (auth_verify). A 4-row table names the sites that intentionally stay on plain Emit (egress proxy subprocess CONNECT, MCP startup events, scheduler tick, startup banners) and why. Issue #175 is named as the lint follow-up. .claude/skills/forge.md — three sections updated: - § 3 path trace: middleware order now shows installSequenceCounterMiddleware as outermost; runner request entry uses EnsureSequenceCounter. - § 12.4 FWS-8 section: added the Emit invariant paragraph naming the regression pins and exception list. - § 18 FWS-8 row: appended #173 / #174 follow-up summary + #175 lint tracker. No code change. TOC anchors unchanged. Broken-link sweep clean.
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
Sync the canonical audit doc and the comprehensive knowledge skill to reflect PR #173 (fix: stamp seq on `tool_exec` + `session_end`) and PR #174 (fix: install `SequenceCounter` before the auth middleware so `auth_verify` lands `seq=1`) — both merged to `main`.
No code change. Docs-only. TOC anchors unchanged. Broken-link sweep is clean.
Changes
`docs/security/audit-logging.md` — under `### Sequence numbers`
Two new H4 subsections:
`.claude/skills/forge.md` — three surgical edits
Test plan
Closes the docs side of #173 and #174. Does NOT close #175 (that's a code follow-up to add the lint).