Skip to content

docs(rfc): RFC-0014 — audit-log schema version 1, a project-owned versioned JSON contract - #203

Merged
gonzafg2 merged 8 commits into
mainfrom
docs/adr-0044-audit-schema-version
Oct 29, 2026
Merged

gonzafg2 merged 8 commits into
mainfrom
docs/adr-0044-audit-schema-version

Conversation

@gonzafg2

@gonzafg2 gonzafg2 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

RFC-0014 defines the audit-log schema as version 1, the first item of the 0.1.0 freeze checklist (#109, docs/plans/phase2-scoping.md). The JSON log becomes a project-owned, versioned contract.

Moved from ADR-0044 to the RFC lane after review. Codex made two points. The frozen log is a new public compatibility contract, which CLAUDE.md sends through the RFC lane. And the freeze refines two accepted RFCs, which an ADR cannot do: RFC-0010 (its configuration-error classes) and RFC-0008 (what authenticated_identity records for certificates).

The 14-day comment period closed on 2026-10-28. The 0.1.0 tag waits for this RFC and for an ml-dsa release (RFC-0012); the SFTP stack landed with #196. The implementing PR flips this RFC to Accepted and adds one ADR that supersedes the affected parts of ADR-0024, ADR-0028 and ADR-0029 (§6).

Refs #109

What an inventory of main (312598c) found

I checked against a real OpenSSH 10.3 session and the release binary:

The proposal

  • Envelope (§2): one flat JSON object per line, with schema_version 1, timestamp, level, then event (catalogue) or message (diagnostics, not part of the contract), then peer_addr and the event's fields. There is no target, span name or span list.
  • Catalogue (§3, §4):
    • Events: ADR-0024's, plus rekey.completed, connection.refused, ADR-0038's request_type/pty, ADR-0041's request_type subsystem and ADR-0042's bytes_received/bytes_sent on exec.finished (landed with feat(sftp): SFTP v3 subsystem in a re-exec helper; exec.finished byte counts (ADR-0041, ADR-0042) #196), server.config_override, and config_file on server.started.
    • Tier: every catalogue event goes on the non-suppressible audit tier.
    • server.config_error becomes class (RFC-0010's four classes plus missing_setting, invalid_host_key, invalid_authorized_keys, bind_failed, runtime_failed and listener_failed) and error.
    • Field rules: every listed field is always present, and enumerations are open.
    • failure_count counts failures within one connection.
  • Compatibility (§5):
    • Additive changes keep version 1: a new event, a new field (conditional only if the change that adds it says so) or a new enumeration value. RFC-0008's certificate fields fall here. The SFTP fields are no longer a planned change: feat(sftp): SFTP v3 subsystem in a re-exec helper; exec.finished byte counts (ADR-0041, ADR-0042) #196 landed them before the freeze, so they are version 1.
    • Breaking changes need version 2, an RFC and a CHANGELOG migration note: removing or renaming, changing a type or meaning, making a field conditional, changing a level, changing the envelope, or moving an event off the tier.
  • Changes to accepted decisions (§6), through one superseding ADR in the implementing PR, since an accepted ADR changes only that way:
    • ADR-0024: the layout, the tier membership, the config_error field, and exec.finished's command.
    • ADR-0028: limit is kept over the reason it names.
    • ADR-0029: the info-level override diagnostic becomes the server.config_override event.
    • RFC-0010: its classes move into class, and server.config_override is the one exception to its "no new audit event names" clause.
    • RFC-0008: authenticated_identity stays the proven key's fingerprint, and the certificate identity goes in additive fields.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • Refactor / chore / CI / build

Checklist

  • My commits are signed off under the Developer Certificate of Origin (git commit -s).
  • My commit messages follow Conventional Commits.
  • I have run cargo fmt --all and cargo clippy --workspace --all-targets -- -D warnings locally. (Documentation only.)
  • I have added or updated tests where appropriate. (The implementing PR adds golden tests per event.)
  • I have updated documentation (rustdoc, docs/, or README.md) where appropriate.
  • I have added a CHANGELOG.md entry under ## [Unreleased] if this change is user-visible. (The implementing PR adds it.)
  • If this change introduces a new dependency, I have justified it in the PR description and verified it passes cargo deny check. (serde_json becomes a direct dependency of the binary in the implementing PR. It is already compiled in through tracing-subscriber's json feature.)

Security considerations

  • No audit record can be turned off by RUST_LOG any more, connection and configuration records included (threat model §2.7).
  • The contract no longer depends on a dependency's output format (§5.5.1).
  • JSON escaping of control bytes stays as it is (§5.4.3).
  • authenticated_identity and executing_uid stay separate first-class fields (§8.12).

Automated reviews

PRs authored by dependabot[bot] (and other bots) do not trigger opencode or Claude Code Review. Codex reviews through the Codex cloud GitHub App (ADR-0037).
They are covered by CI (commit-lint, build (ubuntu-latest) and build (macos-latest) — fmt, clippy, tests, release build —, cargo deny, openssh-interop; cargo audit runs weekly, not per PR) and manual review when needed.

https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW

Update 2026-10-28: rebuilt on main with signed commits. RFC-0014 is brought up to date: SFTP's fields join the version-1 catalogue, RFC-0012 is cited as accepted, #202/#204 as merged, and ADR-0024's command erratum as landed with #196.

@gonzafg2 gonzafg2 added the documentation Improvements or additions to documentation label Oct 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T01:58:18.646767Z 52b828f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: e95a392b-476f-40ab-a852-e7d427ff2008)

github run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ccb47745f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
@claude

claude Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

PR Review: docs(adr): ADR-0044 — freeze the audit-log schema as version 1 (#203)

Decision: 🔴 Blocked
Iteration: First review (Codex review still running; opencode failed with API error — no prior substantive review)
Lenses applied: design decision (docs/adr/0044)

Executive summary

ADR-0044 introduces a versioned, project-owned JSON audit-log schema, correctly satisfying the CLAUDE.md audit-log field mandates (authenticated_identity, executing_uid as separate fields; command as a structured value). The overall design is sound. However, the ADR cites two non-existent files (ADR-0041/0042) as settled decisions, which violates a CLAUDE.md hard rule, and has four important gaps — an unacknowledged audit lockout hole, an ambiguous failure_count definition that freezes a misleading phrase, an undisclosed field addition to exec.finished, and incomplete §5 compatibility rules for closed enumerations and level changes.

New findings

🔴 Blocking (resolve before merge)

[docs/adr/0044-audit-log-schema-v1.md:136,165,276] — CLAUDE.md compliance (confidence: 100)

Problem: ADR-0041 and ADR-0042 are referenced three times as if they are existing, settled decisions — §3 ("ADR-0041, for example"), §5 ("already planned … ADR-0041, ADR-0042"), and the Links section ("additive fields due before the tag"). Neither file exists in the repository (docs/adr/ jumps from 0040 to 0043). They are open proposals living only in PR #195.
Fix: Replace the firm references with pending markers. For example, change "already planned before the tag adds exactly such changes: … (ADR-0041, ADR-0042)" → "planned before the tag (proposed in #195): …"; and in the Links list, "ADR-0041 and ADR-0042 (proposed, #195), additive fields due before the tag."
Anchor: CLAUDE.md — "Do not reference files or paths that do not exist yet as if they do; mark planned work (Phase 2+) as TBD, as the forward-looking ADRs do."

🟡 Important (should be resolved)

[docs/adr/0044-audit-log-schema-v1.md:125,149] — design coherence (confidence: 90)

Problem: §3's exec.finished row lists "the five exec.started fields, plus exit_status" — which makes command a field of exec.finished. But no prior ADR ever added command to exec.finished: ADR-0024 defines exec.finished without it, and ADR-0038 §9 added only request_type and pty to both events. The code does emit command on exec.finished (channel.rs:607), so §3's table is factually correct, but §4's closing sentence "The events, their names and every other field are unchanged" is wrong. This is an undisclosed change.
Fix: Add a bullet to §4's enumerated changes: "exec.finished: gains command (previously on exec.started only), aligning the catalogue with the code."
Anchor: ADR-0024 §exec.finished field list; ADR-0038 §9; CLAUDE.md — "Do not write mock, stub, or placeholder code — everything committed must be functional" (applied here: an ADR that records a freeze must enumerate every actual change).

[docs/adr/0044-audit-log-schema-v1.md:123] — security design (confidence: 88)

Problem: The code emits at most 11 auth.failed events per connection: every failure branch in Expect::authenticate checks attempts >= MAX_AUTH_ATTEMPTS and returns early via reject_sealed before reaching the warn!(target: "audit", … "auth.failed") call. The lockout-triggering attempt produces only a general-tier diagnostic ("post-kex protocol violation", no target: "audit"), which §1 explicitly places outside the contract and which RUST_LOG can suppress. ADR-0044 does not mention this gap, even though it is freezing the auth.failed event as the contract for brute-force detection.
Fix: Either (a) emit auth.failed before the early return in each failure branch, or (b) add a catalogue event auth.locked_out (carrying failure_count), or (c) document the gap explicitly as a known limitation in the Negative consequences section so consumers know not to expect the lockout event.
Anchor: Threat model §2.7 (audit record must contain session lifecycle events); CLAUDE.md hard rule — authenticated_identity and executing_uid on every exec.* event, by analogy showing the audit tier must be self-consistent.

[docs/adr/0044-audit-log-schema-v1.md:132] — security design (confidence: 85)

Problem: Line 132 says "failure_count per source" is "Unchanged from ADR-0024". The code counter (transport.rs:668, let mut failures: u32 = 0;) resets on every new TCP connection, because it is a local in Expect::authenticate scoped to one connection. peer_addr is IP:port, so "per source" describes one connection, not one IP. ADR-0024 used the same wording, but freezing it into the v1 public contract will mislead consumers building cross-connection brute-force detection: a client reconnecting every 11 attempts never exceeds failure_count = 11, and the lockout event (finding above) never appears.
Fix: Replace "failure_count per source" with: "failure_count counts failures within one connection (scoped to the connection span's peer_addr, an IP:port; resets on each new connection). Cross-connection detection must aggregate auth.failed records by the IP portion of peer_addr."
Anchor: Threat model §2.7 (audit record content); §5.5.1 (format stability and consumers relying on stable fields).

[docs/adr/0044-audit-log-schema-v1.md:155-177] — design coherence (confidence: 85)

Problem: §5's compatibility rules leave two scenarios unclassified:

  1. Closed enumerations. §3 marks initiator and trigger on rekey.completed as fixed (e.g., trigger: "time", "bytes", or "peer"); the additive rule names only "a new value of an open enumeration". A consumer matching exhaustively on trigger cannot determine from the ADR whether a fourth value bumps schema_version.
  2. Level changes. §3 fixes a level per event (e.g., kex.failed = WARN, auth.failed = WARN). "Changing an event's level" appears in neither the additive nor the breaking list; consumers routing on level have no guarantee.

Fix: Add two bullet points to the Breaking list in §5: "adding a value to a closed enumeration (one not labelled 'open enumeration' in §3)" and "changing an event's level".
Anchor: §5 is the sole compatibility contract consumers rely on; gaps here undermine the purpose of freezing the schema.


Review by Claude Code (claude-code-action) · CLAUDE.md · REVIEW-FORMAT.md

Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
Comment thread docs/adr/0044-audit-log-schema-v1.md Resolved
gonzafg2 added a commit that referenced this pull request Oct 14, 2026
…ane per review)

Codex on #203: the frozen audit log is a new public compatibility
contract, an RFC under CLAUDE.md; and the freeze refines two accepted
RFCs (RFC-0010's error classes, RFC-0008's authenticated_identity), which
an ADR cannot. ADR-0044 becomes RFC-0014 (Draft, 14-day window).

Review findings folded in:
- server.config_error splits into `class` (RFC-0010's four classes plus
  the startup ones) and `error`, keeping RFC-0010's stable classes
  machine-readable (Codex);
- successful configuration load is recorded: server.started gains
  config_file, server.config_override joins the catalogue (Codex, §2.7);
- connection.refused keeps `limit`, superseding ADR-0028's `reason`
  explicitly (Codex);
- RFC-0008: authenticated_identity stays the proven key's fingerprint;
  certificate fields arrive additively, conditional on certificate
  authentication (Codex);
- exec.finished's `command` listed as a change against ADR-0024
  (claude-review);
- every failed attempt, the budget-exhausting one included, emits
  auth.failed — fixed in #204 (claude-review);
- failure_count is per connection; aggregate by IP (claude-review);
- all enumerations are open; changing an event's level is breaking
  (claude-review);
- the SFTP additions cite #194/#195 as proposed, not as existing ADRs
  (both reviewers).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: 2ed8a6ba-3b39-4d33-82bd-3ec200358d6f)

github run

@gonzafg2 gonzafg2 changed the title docs(adr): ADR-0044 — freeze the audit-log schema as version 1 in a project-owned JSON envelope (Proposed) docs(rfc): RFC-0014 — audit-log schema version 1, a project-owned versioned JSON contract Oct 14, 2026
@gonzafg2
gonzafg2 marked this pull request as draft October 14, 2026 03:10
@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30a1c87e39

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
gonzafg2 added a commit that referenced this pull request Oct 14, 2026
Codex on #203: a startup failure after a successful config load (host
key, authorized_keys, runtime, bind) returns before server.started, so
the error record could not name the configuration that produced it.
config_file is now on every server.config_error as well (the canonical
path once resolved, the path as given if that failed, "" without
--config), so each error record stands on its own.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: 10eabbb4-0793-442c-8fd1-d4dc2190b7ac)

github run

@gonzafg2
gonzafg2 marked this pull request as ready for review October 15, 2026 00:49
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: 5aa795b9-bac4-4c29-bedb-2a0df25b2f58)

github run

@claude

claude Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@gonzafg2
gonzafg2 marked this pull request as draft October 15, 2026 01:01
@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f51a77cbca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
gonzafg2 added a commit that referenced this pull request Oct 17, 2026
…ride-key formats

Codex on #203:
- accepted RFCs are not edited in place (docs/rfcs/README.md, "After
  acceptance"): only ADR-0024 and ADR-0028 gain Status pointers;
  RFC-0010 and RFC-0008 keep their text and this RFC states what it
  supersedes;
- host_key_fingerprint's representation is frozen: `SHA256:` + unpadded
  standard base64 of SHA-256 over the public-key blob (OpenSSH's format);
- server.config_override's `key` values are the TOML paths
  (server.listen, server.host_key, auth.authorized_keys,
  server.handshake_timeout, logging.format); new keys use the same form.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
@opencode-agent

Copy link
Copy Markdown

PR Review: docs(rfc): RFC-0014 — audit-log schema version 1, a project-owned versioned JSON contract (#203)

Decision: 🔴 Blocked
Iteration: Review #2 (prior Codex/Claude rounds: 12 resolved, 2 partly resolved)
Lenses applied: design decision (docs/rfcs/0014); no Rust or CI changes.

Executive summary

RFC-0014 is a substantial improvement over the ADR draft: the envelope, catalogue, field semantics, and compatibility rules are coherent, and the previous review's concrete gaps are largely closed. The remaining problems are process and completeness: the RFC changes accepted ADRs without the required superseding ADRs, §6 omits ADR-0029 and RFC-0010's no-new-event clause, and one reference treats an unmerged RFC as settled. The design itself is sound; the blockers are that the authoritative record would be left contradictory.

Previous issues

# Issue Status Notes
1 Public log schema must go through the RFC lane (Codex) ✅ 30a1c87 moved ADR-0044 to RFC-0014.
2 Nonexistent ADR-0041/0042 cited as settled (Codex, Claude) ✅ 30a1c87 marks #194/#195 as proposed/TBD.
3 Preserve RFC-0010's stable config-error classes (Codex) ✅ §3/§4 carry a class enumeration.
4 Explicitly supersede ADR-0028's reason field name (Codex) 🔄 limit is kept, but the Status-pointer plan is now Finding 1.
5 Add a successful config-load audit record (Codex) ✅ config_file on server.started, plus server.config_override.
6 Include certificate audit semantics before freezing v1 (Codex) ✅ §5/§6 keep one fingerprint format and make certificate fields additive/conditional.
7 Disclose command on exec.finished (Claude) ✅ §6 discloses it; #196 proposes the erratum.
8 The lockout attempt must emit auth.failed (Claude) 🔄 §4 now mandates it; #204 is still open, so main still emits 1–11.
9 failure_count "per source" is ambiguous (Claude) ✅ §4 defines per-connection counting and IP grouping.
10 Classify closed enumerations and level changes (Claude) ✅ §4 opens enumerations; §5 makes level changes breaking.
11 Name the config file on post-load failures (Codex) ✅ config_file on server.config_error.
12 Do not edit accepted RFCs in place (Codex) ✅ 694959c leaves RFC-0010/0008 text untouched.
13 Freeze the host-key fingerprint representation (Codex) ✅ §4 fixes SHA256: + unpadded standard base64.
14 Enumerate the override key tokens (Codex) ✅ §3/§4 fix the five TOML paths and the form.

New findings

🔴 Blocking (resolve before merge)

docs/rfcs/0014-audit-log-schema-v1.md:255-294 — process/ADR supersession (confidence: 90)

Problem: RFC-0014 changes accepted decisions in ADR-0024 (JSON layout, audit-tier membership, server.config_error fields, config_file, server.config_override) and ADR-0028 (reason → limit), but §6 says those ADRs only "gain a Status pointer to it" and §7 says "This RFC needs no separate ADR." The repository's recorded mechanism is a superseding ADR: ADR-0015 and docs/adr/README.md say decision changes "still require a new ADR that supersedes the old one", the lifecycle state is "Superseded by ADR-NNNN", and CLAUDE.md:175-177 says the same. RFC-0008:140-143 and RFC-0010:216-219 also require a superseding ADR for schema changes. A Status pointer to an RFC does not satisfy that mechanism, and the PR body repeats "No separate ADR follows." This leaves ADR-0024/0028 authoritative and contradictory with the accepted RFC.

Fix: Plan superseding ADRs for ADR-0024 and ADR-0028 in the implementing change (for ADR-0028, an annotated erratum is the alternative if reason was a factual error), point their Status fields at those ADRs, and remove or narrow "This RFC needs no separate ADR" to the non-ADR parts.

Anchor: CLAUDE.md:99-102, 175-177 · ADR-0015:36 · docs/adr/README.md:83-98 · RFC-0008:140-143 · RFC-0010:216-219.

docs/rfcs/0014-audit-log-schema-v1.md:188 — dangling reference to an unmerged RFC (confidence: 90)

Problem: "The key type changes with RFC-0012's cut-over" treats RFC-0012 as an existing decision. docs/rfcs/ has no 0012-* file; RFC-0012 exists only as open, unmerged PR #172. This is the same "$TBD" rule the PR already applied to ADR-0041/0042 in 30a1c87.

Fix: Mark it pending, e.g. "The key type changes with the planned RFC-0012 cut-over (open PR #172, TBD), but the representation stays the same", or remove the sentence.

Anchor: CLAUDE.md:173-174.

🟡 Important (should be resolved)

docs/rfcs/0014-audit-log-schema-v1.md:255-290 — incomplete supersession of accepted decisions (confidence: 86)

Problem: §6 lists only ADR-0024 and ADR-0028 as affected. ADR-0029 is also affected: its Related/Decision say failure modes are server.config_error messages with no new event names, and a flag override is logged at info (ADR-0029:6, 76-81). RFC-0014 renames message to class/error and mints server.config_override. RFC-0010:215-219 explicitly says the config surface introduces no new audit event names, and docs/rfcs/README.md:114-116 requires the new RFC to explicitly link and supersede. §6's RFC-0010 bullet only supersedes the "four classes are values of message" sentence, not the no-new-event sentence.

Fix: Add ADR-0029 to §6; add a clause-level supersession of RFC-0010's "no new audit event names" for server.config_override (in the RFC-0011 style), noting RFC-0010's text stays as written; record the change to ADR-0029's failure-mode/override statements in the superseding ADR or erratum.

Anchor: docs/rfcs/README.md:107-116 · RFC-0010:215-219 · ADR-0029:6, 76-81 · CLAUDE.md:99-102.

github run

@opencode-agent

Copy link
Copy Markdown

APIError: Insufficient Balance (request_id: d4f17a28-100d-4853-9681-73d12cf59869)

github run

gonzafg2 added a commit that referenced this pull request Oct 28, 2026
…24) (#204)

* fix(auth): audit the failure that exhausts the attempt budget (ADR-0024)

Every failure branch of Expect::authenticate checked
`attempts >= MAX_AUTH_ATTEMPTS` and disconnected before emitting
auth.failed, and the probe path checked the budget before looking the
key up. The twelfth failure — the one that ends the connection — left no
audit record, only the general-tier "post-kex protocol violation" line,
which RUST_LOG can suppress. ADR-0024 audits every failed attempt.

auth.failed is now emitted before the budget check on every failure
path, and an unknown-key probe is counted and audited before it.

Tests: the max-attempts test now captures the audit events and expects
failure_count 1..=12, for signed requests and for unsigned probes; both
fail on main (1..=11).

Found by claude-review on #203 (the audit-schema freeze).

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

* docs(changelog): the auth.failed fix for the budget-exhausting attempt

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>

---------

Signed-off-by: Gonzalo Fleming <[email protected]>
…roject-owned JSON envelope (Proposed)

The first item of the 0.1.0 freeze checklist. The JSON log becomes a
project-owned, versioned contract:

- envelope: one flat object per line — schema_version (1), timestamp,
  level, event (catalogue) or message (diagnostics), peer_addr, then the
  event's fields; no target, span name or span list; a FormatEvent in
  the binary encoding with serde_json (already in the build);
- the version-1 catalogue: ADR-0024's events plus rekey.completed,
  connection.refused and ADR-0038's fields, all on the non-suppressible
  audit tier (six events move there);
- server.config_error's `message` field becomes `error` (today it
  duplicates the JSON key that holds the event name);
- compatibility: additive changes (new event, field or open-enumeration
  value) keep version 1; anything else bumps it with an ADR and a
  CHANGELOG migration note.

The inventory also found audit events without peer_addr — fixed in #202.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
…ane per review)

Codex on #203: the frozen audit log is a new public compatibility
contract, an RFC under CLAUDE.md; and the freeze refines two accepted
RFCs (RFC-0010's error classes, RFC-0008's authenticated_identity), which
an ADR cannot. ADR-0044 becomes RFC-0014 (Draft, 14-day window).

Review findings folded in:
- server.config_error splits into `class` (RFC-0010's four classes plus
  the startup ones) and `error`, keeping RFC-0010's stable classes
  machine-readable (Codex);
- successful configuration load is recorded: server.started gains
  config_file, server.config_override joins the catalogue (Codex, §2.7);
- connection.refused keeps `limit`, superseding ADR-0028's `reason`
  explicitly (Codex);
- RFC-0008: authenticated_identity stays the proven key's fingerprint;
  certificate fields arrive additively, conditional on certificate
  authentication (Codex);
- exec.finished's `command` listed as a change against ADR-0024
  (claude-review);
- every failed attempt, the budget-exhausting one included, emits
  auth.failed — fixed in #204 (claude-review);
- failure_count is per connection; aggregate by IP (claude-review);
- all enumerations are open; changing an event's level is breaking
  (claude-review);
- the SFTP additions cite #194/#195 as proposed, not as existing ADRs
  (both reviewers).

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
Codex on #203: a startup failure after a successful config load (host
key, authorized_keys, runtime, bind) returns before server.started, so
the error record could not name the configuration that produced it.
config_file is now on every server.config_error as well (the canonical
path once resolved, the path as given if that failed, "" without
--config), so each error record stands on its own.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
…ride-key formats

Codex on #203:
- accepted RFCs are not edited in place (docs/rfcs/README.md, "After
  acceptance"): only ADR-0024 and ADR-0028 gain Status pointers;
  RFC-0010 and RFC-0008 keep their text and this RFC states what it
  supersedes;
- host_key_fingerprint's representation is frozen: `SHA256:` + unpadded
  standard base64 of SHA-256 over the public-key blob (OpenSSH's format);
- server.config_override's `key` values are the TOML paths
  (server.listen, server.host_key, auth.authorized_keys,
  server.handshake_timeout, logging.format); new keys use the same form.

Refs #109

Claude-Session: https://claude.ai/code/session_01HxXXh6HEpJBs7tbuz3NmtW
Signed-off-by: Gonzalo Fleming <[email protected]>
… ADR-0024/0028/0029

docs/adr/README.md allows an accepted ADR to change only through a
superseding ADR, so the implementing PR adds one that supersedes the
listed parts of ADR-0024, ADR-0028 and ADR-0029, as ADR-0031 does for
ADR-0008. ADR-0029's info-level override diagnostic and RFC-0010's
"no new audit event names" clause join §6, since server.config_override
changes both. RFC-0012 is cited as proposed (#172, TBD).

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>
… up to date

#196 landed the SFTP stack before the freeze, so request_type subsystem
and exec.finished's bytes_received and bytes_sent move from the planned
additive changes into the version-1 catalogue (§3, §4), with command
"sftp" for the subsystem. RFC-0012 is cited as accepted, the two audit
gaps as fixed (#202, #204), and ADR-0024's command erratum as landed
with #196.

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2
gonzafg2 force-pushed the docs/adr-0044-audit-schema-version branch from 776b5e0 to d1bde65 Compare October 29, 2026 01:37
@gonzafg2
gonzafg2 marked this pull request as ready for review October 29, 2026 01:40
@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

Copy link
Copy Markdown
Owner Author

@claude review

@claude

claude Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @gonzafg2's task in 28s —— View job


Review of RFC-0014 (docs/rfcs/0014-audit-log-schema-v1.md)

Decision: 🟢 No blockers. I found two non-blocking nits.

I read the whole file and checked its cross-references against the repo:

  • Files that exist: RFC-0008, RFC-0012 (Accepted (2026-10-28)), RFC-0013, and ADR-0028, ADR-0029, ADR-0041 and ADR-0042.
  • Supersession precedent: ADR-0008's Status really does point at ADR-0031, so the precedent §6 cites is real.
  • SFTP command: ADR-0041 sets command = "sftp", which matches §4.
  • Section count: the "seven things" in §7 matches its seven bullets.

Against CLAUDE.md:

  • Hybrid KEX, zero legacy, unsafe: the RFC doesn't touch any of them.
  • authenticated_identity and executing_uid: both stay separate first-class fields (§4).
  • command: stays a structured field.
  • Accepted ADRs and RFCs: they change only through a superseding ADR (§6). RFC-0008 and RFC-0010 are not edited in place.
  • serde_json: it is justified as already in the tree (§7).
  • Forward references: the TBD items (certificate fields, implementation PR) are marked TBD.

The two earlier blockers from the opencode round are resolved. RFC-0012 is cited as accepted, and ADR-0029 and RFC-0010's "no new audit event names" clause are covered in §6.

🟡 Nits (non-blocking)

  1. The kex.failed reason list is not pinned (§3, line 156).

    • Problem: it lists no-hybrid-kex, no-strict-kex, …. That is the same gap Codex raised for the override key tokens, which you fixed in §4. Alerting rules on kex.failed will match on these tokens.
    • Fix: list the tokens the code emits today in §4 and keep the enumeration open. Better to fix them now than to find an undocumented token after the freeze.
  2. The Summary says "three accepted decisions" but lists five documents (lines 23–30).

    • Problem: it lists ADR-0024, ADR-0028, ADR-0029, RFC-0010 and RFC-0008.
    • Fix: say "the accepted decisions below" or "five".

Informational

…SFTP wording

kex.failed's reason was "no-hybrid-kex, no-strict-kex, …". §4 now lists
the eleven tokens the transport emits with disconnect code 3 and keeps
the enumeration open, as for the override keys. The Summary counts five
documents, not three decisions, and the SFTP note moves out of the
planned-change list.

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

Copy link
Copy Markdown
Owner Author

Thanks. Applied in 4a9b58f:

  1. kex.failed reason tokens: now pinned in §4. They are the eleven tokens the transport emits with disconnect code 3 (kex.rs Rejection::kex_failed, plus rekey-timeout in transport.rs):

    • negotiation: no-hybrid-kex, no-strict-kex, no-host-key-algorithm, no-cipher-c2s, no-cipher-s2c, no-compression;
    • the hybrid exchange: bad-hybrid-init-length, invalid-mlkem-key, invalid-x25519-key, rng-failure;
    • re-key: rekey-timeout.

    The enumeration stays open. A malformed packet (malformed-*, code 2) is a protocol violation, not a kex.failed, and connection.closed carries it. The §3 row now points at §4.

  2. Summary count: now reads "accepted decisions in five documents".

  3. SFTP wording: the note now follows the planned-change list as its own paragraph.

@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

Copy link
Copy Markdown
Owner Author

@claude review 4a9b58f on top of your last review: the pinned kex.failed reason tokens in §4 (checked against kex.rs and transport.rs), the Summary count, and the SFTP note's placement.

@claude

claude Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @gonzafg2's task in 21s —— View job


Review of 4a9b58f (RFC-0014)

Decision: 🟢 No blockers. All three follow-ups are resolved, and I found no new issues.

  • Pinned kex.failed reason tokens (§4)
  • Summary count
  • SFTP note placement

1. kex.failed tokens (§4, docs/rfcs/0014-audit-log-schema-v1.md:220-232)

  • The eleven tokens match the code. I checked every Rejection::kex_failed(...) call in kex.rs, and the rekey-timeout reason in transport.rs:1358.
    • Negotiation: no-hybrid-kex (kex.rs:277), no-strict-kex (:283), no-host-key-algorithm (:288), no-cipher-c2s (:303), no-cipher-s2c (:306), no-compression (:315).
    • Hybrid exchange: bad-hybrid-init-length (:645, :654, :677), invalid-mlkem-key (:656), rng-failure (:659, :680), invalid-x25519-key (:685).
    • Re-key: rekey-timeout (transport.rs:1358), with disconnect_code: DISCONNECT_KEY_EXCHANGE_FAILED.
  • Nothing is missing. No other call site in transport.rs or elsewhere emits a kex_failed reason.
  • Code 3 only. The note that malformed-* (code 2) is a protocol violation carried by connection.closed, not a kex.failed, is consistent with transport.rs:1524, which keys on code 3.
  • The enumeration stays open. A new cause is a new token, which fits the additive rule in §5.
  • §3 row. It points to §4.

2. Summary count (line 23). "Accepted decisions in five documents" matches the bullets: ADR-0024, ADR-0028, ADR-0029, RFC-0010 and RFC-0008.

3. SFTP note (§5, lines 249-257). It now sits after the certificate bullet as its own paragraph and reads clearly. It says SFTP is not a planned change, and that subsystem and the byte counts are version 1 because #196 landed before the freeze. That agrees with the other #196 reference near line 293.

Informational: The RFC stays Draft, as expected. The implementing PR flips it to Accepted and adds the superseding ADR.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 4a9b58f609

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
Comment thread docs/rfcs/0014-audit-log-schema-v1.md Resolved
…scape, threat-model qualifiers

From claude-review on 4a9b58f:
- §4 pins exit_status: the exit code, 128 + n for a signal (also with
  exit-signal on the wire), and 127 when the child could not be started
  or waited on or no status was recorded.
- §2 and §7: the JSON encoder escapes every char::is_control character
  (C0, DEL, C1) as \u00XX, the set the human formatter escapes;
  serde_json alone covers only C0.
- Three threat-model citations (§2.7, §8.12) carry the qualifier.

Claude-Session: https://claude.ai/code/session_01QpBZ4qUr3ypV22CvmVwwHp
Signed-off-by: Gonzalo Fleming <[email protected]>
@gonzafg2

Copy link
Copy Markdown
Owner Author

@codex review

@gonzafg2

Copy link
Copy Markdown
Owner Author

@claude review 52b828f: the exit_status semantics in §4, the full char::is_control escape in §2 and §7, and the threat-model qualifiers, answering the five inline threads from the last claude-review round.

@claude

claude Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @gonzafg2's task in 22s —— View job


Review of 52b828f (RFC-0014)

Decision: 🟢 No blockers. All five threads from the last round are resolved, and I found no new issues.

  • exit_status semantics (§4)
  • Full char::is_control escape (§2, §7)
  • Threat-model qualifiers

1. exit_status (§4)

  • The sentinels match the code.
    • 127: EXIT_SPAWN_FAILED (channel.rs:84) covers a failed spawn at channel.rs:989. It is also the fallback when no status was recorded, at channel.rs:622 (unwrap_or). EXIT_WAIT_FAILED (exec.rs:59) covers a failed wait.
    • 128 + n: exec.rs:913 computes it for a signal death.
    • Other 128 + n paths: the timeout paths at exec.rs:973 and exec.rs:989 use the same form, so the text covers them.
  • The exit-signal clause agrees with ADR-0038 §8. The "also when exit-signal went on the wire" wording matches ADR-0038's line that exit_status keeps its meaning of the exit code or 128 + n. The log value does not depend on which wire message was sent.
  • The caveat is the right one. It says a real 127 or 128 + n reads the same, so a consumer must not treat 127 alone as a start failure.

2. Control-character escape (§2, §7)

  • §2 is exact. It names the char::is_control set (U+0000–U+001F, U+007F–U+009F) and says serde_json alone covers only C0. That matches log_fields.rs:93-97, which documents the same set.
  • §7 gives the implementation order. String values go through the is_control escape first, then serde_json, which leaves DEL and C1 untouched. That closes the pre-auth path through the client-chosen auth_method.
  • One thing for the implementing PR. Its golden tests should include a DEL and a U+009B case. Escaping before serde_json also makes the \u00XX output a deliberate choice, not an accident of the encoder.

3. Threat-model qualifiers

  • All four citations now carry "threat model": lines 194 (§2.7, §8.12), 224 and 396, plus line 67, which already did. No bare §2.7 or §8.12 remains.

Informational: the RFC stays Draft, as expected. The implementing PR flips it to Accepted and adds the superseding ADR.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 52b828f4e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@gonzafg2
gonzafg2 merged commit 12b7ef2 into main Oct 29, 2026
21 checks passed
@gonzafg2
gonzafg2 deleted the docs/adr-0044-audit-schema-version branch October 29, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant