Skip to content

fix: close deterministic agent-artifact intake normalization lifecycle#484

Merged
Stahl-G merged 18 commits into
mainfrom
codex/agent-artifact-intake-normalization
Jul 11, 2026
Merged

fix: close deterministic agent-artifact intake normalization lifecycle#484
Stahl-G merged 18 commits into
mainfrom
codex/agent-artifact-intake-normalization

Conversation

@Stahl-G

@Stahl-G Stahl-G commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Merge Unit

MU-3: deterministic agent-artifact intake normalization lifecycle.

Final head: 975f9390846bc642fa12e83fdd44ce60dc28753e

Base after the path-authority predecessor (#487):
3834af60e24dde0fba43aea8f50e91d0ce0a0092

Complete PR diff: 29 files, +5898/-373.

Opening Contract

Invariant:
  candidate_claims, screened_candidates, and claim_drafts are raw agent
  proposals. One deterministic evaluator owns bounded mechanical
  normalization, canonical normalized bytes, digests, strict validation, and
  typed findings. The artifact registry persists the current-run intake
  projection. Deterministic consumers use that projection/bundle and never
  treat normalized validity as permission to clear repair/supersede staleness.

Producer:
  multi_agent_brief.contracts.agent_artifact_intake

Authority records:
  artifact_registry.json artifacts[artifact_id].intake_projection
    schema: briefloop.intake_projection.v1
  runtime_manifest.json claim_ledger_freeze
    new writes: mabw.claim_ledger_freeze.v2
    legacy reads: explicit v1 lineage validation only

Writers/recomputers:
  intake evaluator; artifact registry recomputer; Claim Ledger freeze and
  metadata-enrichment transactions.

Consumers:
  registry validation; Scout/Screener stage and topology completion; screened
  universe validation; Claim Ledger freeze/repeat/completion; coverage gates;
  materiality projection; status diagnostics.

Consumers may:
  read raw proposals; consume normalized payloads and persisted diagnostics;
  reject invalid, stale, mismatched, cross-run, or malformed authority.

Consumers may not:
  rewrite raw proposals; invent evidence identity; map ambiguous semantics;
  maintain local alias/hash/universe rules; infer current validity from file
  presence; clear stale_after_repair or stale_after_supersede.

Run/transaction identity:
  registry run_id equals manifest run_id; projections bind artifact_id, raw
  SHA, normalized SHA, transform version, counts, and typed entries; freeze v2
  binds current run, transaction, source projection, paths, event, and ledger.

Legacy behavior:
  no old-workspace migration or silent upgrade. Unknown schema/transform and
  missing authority fail closed. A supported v1 freeze must prove current-run
  event lineage; post-freeze enrichment must prove immutable old-to-new hashes.

Path boundary:
  canonical path production and generic gate-consumer migration are inherited
  from merged predecessor #487. This PR adds only the agent-intake selector and
  intake/freeze consumer bindings; it does not create a second path authority.

Non-goals / deferred:
  registry sibling-inference debt outside the migrated gate-impacting paths;
  status/Panel wording redesign; old-workspace migration; hardlink/casefold
  platform policy beyond #487; renderer/finalize-audit path migration; MU-4.

State x Path Matrix

ID State / path Deterministic outcome Representative test
INTAKE-PARSE-01 canonical candidate payload valid; no normalization; both digests test_candidate_intake_canonical
INTAKE-PARSE-02 malformed JSON typed fatal parse finding test_candidate_intake_malformed_json
INTAKE-ALIAS-01 canonical/alias conflict exact-path fatal finding test_candidate_intake_alias_conflict
INTAKE-ID-01 missing/duplicate candidate ID fail closed test_candidate_intake_requires_candidate_id; test_candidate_intake_duplicate_ids
INTAKE-ID-02 malformed supplied source identity shared validators reject test_legacy_candidate_supplied_identity_fields_are_validated
INTAKE-SCREEN-01 selected/excluded mechanical aliases one normalized screening shape test_screened_bucket_aliases
INTAKE-SCREEN-02 prose reason without reason_code no consumer-local inference test_screened_reason_not_reason_code
INTAKE-UNIVERSE-01 unknown/duplicate/missing/count mismatch registry, coverage, materiality share one invalid verdict test_workspace_intake_bundle_owns_screened_universe_verdict
INTAKE-UNIVERSE-02 missing candidate universe screened intake fails closed test_workspace_intake_bundle_rejects_missing_candidate_universe
INTAKE-UNIVERSE-03 registry-invalid screening reaches quality gate no report and no pass event test_coverage_gate_rejects_screened_candidate_universe_mismatch
INTAKE-PATH-01 custom candidate/screened paths; poisoned defaults quality/materiality consume contract bindings test_quality_and_materiality_bind_contract_resolved_intake_paths
INTAKE-DRAFT-01 bounded draft aliases canonical drafts; raw unchanged test_claim_draft_mechanical_normalization
INTAKE-DRAFT-02 unknown claim type or nested claim_id fatal before freeze test_claim_draft_unknown_claim_type; test_claim_draft_nested_claim_id
INTAKE-REGISTRY-01 malformed/impossible projection persisted authority rejected test_intake_projection_internal_binding_fails_closed; test_projection_rejects_impossible_status_digest_finding_combination
INTAKE-REGISTRY-02 transplanted artifact projection/status artifact identity/status binding rejected test_registry_intake_projection_binds_artifact_identity_and_status
INTAKE-REGISTRY-03 cross-run or unknown version fail closed test_registry_intake_projection_rejects_cross_run_context; test_registry_intake_projection_rejects_unknown_version
INTAKE-STALE-01 intake-valid plus repair/supersede stale stale remains non-consumable test_screened_intake_consumption_rejects_stale_registry_dependencies
INTAKE-STALE-02 intake-invalid plus stale baseline invalid > stale > valid test_invalid_intake_precedes_recovery_stale_overlay
INTAKE-FREEZE-01 real freeze from normalized drafts v2 binds raw/normalized/registry/event identities test_freeze_binds_intake_projection
INTAKE-FREEZE-02 registry/evaluator mismatch reject before writes test_freeze_rejects_projection_mismatch
INTAKE-FREEZE-03 repeat raw/policy drift reject even if normalized bytes appear equivalent test_repeat_freeze_rejects_raw_drift; test_repeat_freeze_rejects_policy_drift
INTAKE-FREEZE-04 partial event/state failure atomic rollback test_freeze_intake_binding_rolls_back_atomically
INTAKE-FREEZE-05 stale claim_drafts repeat freeze and stage completion blocked test_stale_claim_drafts_blocks_repeat_freeze_and_stage_completion
INTAKE-LEGACY-01 v1 freeze transplanted cross-run reject without matching current-run event test_legacy_freeze_rejects_cross_run_transplant
INTAKE-LEGACY-02 duplicate/wrong freeze event require exactly one matching stage/artifact event test_freeze_binding_rejects_duplicate_transaction_events; test_freeze_binding_rejects_wrong_event_identity
INTAKE-LEGACY-03 v1 freeze then deterministic enrichment immutable event anchors old hash; lineage binds new hash test_legacy_freeze_remains_valid_after_metadata_enrichment
INTAKE-LEGACY-04 corrupted/missing enrichment lineage fail closed test_legacy_freeze_rejects_invalid_metadata_enrichment_lineage
INTAKE-PATH-02 custom drafts/Ledger through freeze and enrichment registry/manifest/event share contract identity; defaults untouched test_metadata_enrichment_binds_claim_paths_from_artifact_contracts
INTAKE-PATH-03 finalize gate metadata uses custom Ledger completion quality-binding uses the same contract Ledger test_metadata_enrichment_binds_claim_paths_from_artifact_contracts
INTAKE-STATUS-01 valid and corrupted projections compact diagnostics; corruption unavailable test_status_formats_intake_projection; test_status_rejects_invalid_intake_projection
INTAKE-E2E-01 public-safe recoverable/fatal fixtures recoverable progresses; identity fatal is stable test_public_safe_recoverable_intake_fixture; test_public_safe_fatal_intake_fixture

Consumer Sweep

  • CLI/runtime stage completion: migrated for agent artifacts.
  • Registry/state recompute: one dependency-ordered intake bundle and persisted projection.
  • Claim Ledger freeze/repeat/enrichment/completion: current-run and event-bound.
  • Quality coverage/materiality/status: same bundle plus registry stale eligibility.
  • Generated Scout assets: source role contract updated first; generated mirrors in sync.
  • WorkBuddy/Hermes adapters remain non-authoritative raw-proposal readers.
  • Generic path producer and CSM/atomic/auditor path consumers come from fix: bind gate consumers to artifact path authority #487.

Validation

Final-head local results:

  • focused intake/materiality/quality/status: 151 passed
  • runtime state lifecycle: 414 passed
  • full repository suite: 2986 passed
  • Ruff on all changed Python files: passed
  • generated agent configs: passed
  • version consistency: passed
  • release consistency (--no-tag): passed
  • capabilities (current src): passed
  • product baseline: passed
  • public safety: passed
  • git diff --check: passed
  • README.md and README_en.md: inspected; unchanged

Authority Declaration

New independent authority file: no
Authority schema/semantics changed: yes
Authority lifecycle/consumer binding changed: yes
Raw proposal mutation: no
Old workspace migration: no

@Stahl-G Stahl-G marked this pull request as ready for review July 10, 2026 15:59

@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: 20d62ad562

ℹ️ 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 src/multi_agent_brief/contracts/agent_artifact_intake.py Outdated
@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, add credits to your account and enable them for code reviews in your settings.

Comment thread src/multi_agent_brief/orchestrator/runtime_state/completion_gates.py Outdated

@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: bf72ab1ca7

ℹ️ 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 src/multi_agent_brief/orchestrator/runtime_state/completion_gates.py Outdated

@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: aa06ddc60e

ℹ️ 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 src/multi_agent_brief/contracts/agent_artifact_intake.py
Comment thread src/multi_agent_brief/product/materiality_selection.py Outdated

@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: 4744c31376

ℹ️ 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 src/multi_agent_brief/quality_gates/state.py Outdated

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 325588e. Configure here.

@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: e5a7a7c37a

ℹ️ 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 src/multi_agent_brief/orchestrator/runtime_state/claim_ledger_freeze.py Outdated

@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: cf980fb59b

ℹ️ 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 src/multi_agent_brief/orchestrator/runtime_state/claim_ledger_freeze.py Outdated
@cursor

cursor Bot commented Jul 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_046cf662-4303-4db9-9d90-f1e7626ff4ff)

@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: 59bef1238e

ℹ️ 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 src/multi_agent_brief/orchestrator/runtime_state/artifact_registry.py Outdated

@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: 06a6d8c81b

ℹ️ 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 src/multi_agent_brief/orchestrator/runtime_state/claim_ledger_freeze.py Outdated

@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: 4fd8188285

ℹ️ 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 src/multi_agent_brief/quality_gates/state.py
# Conflicts:
#	src/multi_agent_brief/orchestrator/runtime_state/artifact_paths.py
#	src/multi_agent_brief/orchestrator/runtime_state/artifact_registry.py
#	src/multi_agent_brief/orchestrator/runtime_state/claim_support_matrix.py
#	src/multi_agent_brief/orchestrator/runtime_state/completion_gates.py
#	src/multi_agent_brief/orchestrator/runtime_state/contracts_loader.py
#	src/multi_agent_brief/quality_gates/state.py
#	tests/test_runtime_state.py
@Stahl-G

Stahl-G commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@Stahl-G

Stahl-G commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

Northstar product review

Decision: DO NOW / accept the bounded MU-3 slice, subject to final CI and review.

  • User and job: a BriefLoop operator needs agent-authored workflow artifacts to cross one deterministic intake boundary without registry, gate, freeze, and status surfaces giving different answers.
  • Evidence: repeated reproducible control-plane defects and adversarial lifecycle cases. This is engineering/safety evidence; it is not evidence that report quality or user value improved.
  • Product invariant: agents propose; deterministic Python validates, records, freezes, and gates. Normalized validity cannot erase repair/supersede staleness.
  • MVP: one evaluator, one persisted current-run projection, bound freeze lineage, and the in-scope completion/coverage/materiality/status consumers.
  • Non-goals retained: no old-workspace migration, second authority, new user-facing concept, broader filesystem governance, renderer/finalize-audit migration, or public capability upgrade.
  • Public-claim boundary: this PR supports a stronger deterministic control invariant only. It does not justify claims of better factual accuracy, semantic quality, or Pilot readiness.

The predecessor path-authority work is now in #487/main; the final #484 diff removes the duplicate path-authority package and keeps only the thin intake binding needed by MU-3.

@Stahl-G Stahl-G merged commit 3042927 into main Jul 11, 2026
8 checks passed

@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: 975f939084

ℹ️ 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 on lines +102 to +105
artifact_paths = agent_artifact_paths_from_contracts(
ws,
artifact_records if isinstance(artifact_records, Mapping) else {},
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle invalid registry paths in status projections

When briefloop status reads a corrupt or tampered artifact_registry.json whose agent artifact path is unsafe (for example ../evil), this call raises RuntimeStateError from the artifact path resolver and aborts the whole read-only status summary. build_workspace_status is documented to only read existing files and report corrupt surfaces as stale/unknown, so the materiality projection should catch this and return an invalid_screened_candidates/unavailable projection instead of letting a bad registry path crash status.

Useful? React with 👍 / 👎.

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