Skip to content

spec(hooks): stop requiring postCompact fields a sender cannot fill - #517

Open
drk-ram wants to merge 1 commit into
GenAI-Security-Project:integrationfrom
drk-ram:spec/post-compact-honest-fields-382
Open

drk-ram wants to merge 1 commit into
GenAI-Security-Project:integrationfrom
drk-ram:spec/post-compact-honest-fields-382

Conversation

@drk-ram

@drk-ram drk-ram commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

What changed

postCompact no longer requires fields a sender cannot honestly fill. post_compact_chain_hash leaves the payload, because the Guardian writes that ContextEntry and publishes the value as the response's chain_hash (section 8.6). pre_compact_chain_hash becomes optional, and summary.provenance becomes optional in postCompact, turnEnd and subagentStop. New *.acs-provenance.json variants for those three hooks put summary.provenance back for ACS-Provenance deployments.

Which issue does this implement

Closes #382

  • This is an editorial correction (typo, grammar, link, formatting) with no change in
    meaning, so it needs no issue

Base branch

  • integration, because this touches the specification, schemas, a reference
    implementation, an adapter, tests, or CI
  • main, because every changed path is on the documentation lane allowlist in
    CONTRIBUTING.md

Type of change

  • Specification change (schema, hooks, events, AgBOM)
  • Reference implementation or adapter
  • Documentation
  • Tooling or CI
  • Governance (licensing, security policy, contributor docs)

Specification changes

  • I opened a Discussion before this PR
  • Schema changes validate against the JSON Schema spec
  • I described the impact on downstream implementers below

Breaking for implementers? No for senders: every change relaxes a requirement, so a payload that validated before still validates, and a sender that was sending post_compact_chain_hash still validates because the schema is open. A Guardian that read post_compact_chain_hash from the request should take the value from its own chain. A deployment claiming ACS-Provenance should validate postCompact, turnEnd and subagentStop against the new strict variants to keep the old requirement on summary.provenance.

Choices made:

  • Who reports the hash. The Guardian, as chain_hash on the response, which section 8.6 already requires. Removing the field also removes the self-hash under ACS-Audit.
  • pre_compact_chain_hash. Optional, following the final_chain_hash precedent on subagentStop. The Guardian holds the same value in its chain, and a supplied value that disagrees is a chain_mismatch. This goes slightly beyond the issue text, which names only the post hash, because a client that tracks no chain cannot fill the pre hash either.
  • Strict variants. Section 7 says ACS-Provenance requires provenance on every data-bearing field, and the strict variants are how the repository states that. The three hooks had none, so relaxing the base schemas alone would have dropped the requirement.

I tested this

  • I synced my branch with the base branch before opening this

  • uv run pytest -v passes on my machine

  • uv run mkdocs build --strict passes on my machine

  • uv run pytest tests/test_post_compact_fields.py tests/test_hook_taxonomy.py tests/test_publish_schemas.py -q: the new file and the taxonomy tests pass. The two symlink tests in test_publish_schemas.py fail here because Windows denies symlink creation.

  • uv run pytest -q: 1225 passed, 10 failed, 20 errors. The failures and errors are the symlink, subprocess and timing tests in test_fetch_roadmap, test_overrides, test_pr_intake_workflow, test_publish_schemas and test_closing_choice that fail on this Windows machine without this change.

  • uv run mkdocs build --strict: passes

Checklist

  • Commits are signed off with git commit -s (required by the DCO)
  • Prose follows STYLE.md
  • No secrets, tokens, or internal URLs in the diff

Security

  • This change has no security impact

postCompact required post_compact_chain_hash, the chain hash after the
Guardian writes the postCompact ContextEntry. The Guardian chooses that
entry's entry_id, so the sender cannot compute the value, and under
ACS-Audit request_hash covers params, so the value would hash itself. It
also required summary.provenance, which a provenance_producer: none client
does not emit, so a conformant ACS-Core client could not send a valid
postCompact. turnEnd and subagentStop had the same shape whenever summary
was present.

Drop post_compact_chain_hash from the payload: the Guardian publishes that
value as the response chain_hash (section 8.6). Make pre_compact_chain_hash
optional, as final_chain_hash already is on subagentStop, so a client that
tracks no chain omits it rather than fabricating it. Make summary.provenance
optional in the three base schemas and restore it under ACS-Provenance with
post-compact, turn-end and subagent-stop acs-provenance variants. Update the
Hooks page and section 7 and 8.6 prose to match.

Closes GenAI-Security-Project#382

Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Thanks for this. It is queued rather than ignored. A lead has not reviewed this pull request yet. A lead will read it when they have time, and we can't promise a date. Nothing here is rejected. If a check below fails, please fix it. A pull request that waits a long time may be closed, and you can reopen it later.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

This pull request's description says it closes #382, which is on the project roadmap. When it merges, GitHub closes that issue and the roadmap counts it as delivered. Please confirm the change delivers the whole issue before merging.

@acs-board-reconciler acs-board-reconciler Bot moved this from Needs triage to In progress in ACS Project Tracker Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Not yet triaged. Applied by the issue forms

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

[Bug] postCompact requires fields a sender cannot honestly fill

1 participant