Skip to content

docs(changelog): Correct the audit-dedup reconciler attribution - #20

Merged
ikorich merged 1 commit into
masterfrom
docs/correct-audit-dedup-attribution
Aug 15, 2026
Merged

ikorich merged 1 commit into
masterfrom
docs/correct-audit-dedup-attribution

Conversation

@ikorich

@ikorich ikorich commented Aug 15, 2026

Copy link
Copy Markdown
Member

Motivation

The changelog entry shipped with the audit-dedup fix states that "the header comment in both hooks promised that 'the orchestrator's audit-dedup hook' would reconcile these rows, but no such hook exists."

That is wrong. A reconciler does exist — corpflow's skills/agent-coordination/scripts/audit-dedup.sh:

Reads .context/logs/audit.jsonl … for every group of rows sharing metadata.dedupe_key, prefer the row whose actor starts with hook: … Agent-emitted rows for the same key are dropped.

It has contract tests (tests/shell/skills/agent-coordination__audit-dedup.bats) and a --self-test.

What was actually true

It is a read-time filter invoked only by /cost-report, to avoid double-counting effort in aggregation. It is not a hook and does not run automatically. So the duplicate rows still accumulate on disk in full, and every other reader of the trail — the retrospective, refine-branch-target.sh, publish-pl-issue.sh, anyone grepping — still pays for them.

The hook headers are a misnomer on two counts: what they name an "audit-dedup hook" is neither a hook nor automatic.

What is unchanged

  • The symptom — 80% of rows measured redundant (2,265 of 2,837 in a five-hour run).
  • The fix — dropping the advisory row at write time prevents the write rather than filtering after it.
  • Correctness alongside audit-dedup.sh — the canonical hook:* row is never suppressed by the write-time check, so a later read-time dedup still resolves every group the same way. Verified against the script's stated contract.

Only the justification was wrong, and wrong in a way that could send a maintainer off to build something that already exists — which is why it is worth correcting in the durable record rather than only in a report.

Changes

CHANGELOG.md only. No code change, no version bump: this corrects the description of an already-released entry.

Test plan

Documentation-only; no behaviour to test. The underlying fix was verified when it shipped: six plugin hooks driven with one payload produced 1 row (was 6); three distinct payloads produced 3 rows (no over-suppression); an advisory-then-canonical pair produced 2 rows with the canonical row present; 12/12 hook self-tests pass.

Notes

Found while locating the bats suites that cover corpflow PR #300 — the existence of agent-coordination__audit-dedup.bats is what surfaced the error.

The shipped entry claimed no audit-dedup reconciler existed. One does:
corpflow's skills/agent-coordination/scripts/audit-dedup.sh, which keeps the
hook:* row and drops agent rows sharing a dedupe_key.

It is a read-time filter invoked only by /cost-report, not the automatic
"audit-dedup hook" the hook headers name — so the duplicate rows do still
accumulate on disk in full, and every reader other than /cost-report still
pays for them. The symptom and the fix are unchanged; only the justification
was wrong, and it was wrong in a way that could send a maintainer off to build
a reconciler that already exists.

Also notes that the write-time drop is consistent with audit-dedup.sh: the
canonical hook:* row is never suppressed, so a later read-time dedup resolves
every group identically.

No code change, no version bump — this corrects the description of an
already-released entry.
@ikorich
ikorich merged commit d820483 into master Aug 15, 2026
2 checks passed
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