Publish portable PortfolioTruth consumer contract - #210
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e326397607
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d16ed6492
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1092128422
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1e4d3c675
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b73b9e127b
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc8dddb89e
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c20bddf1c9
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88b89cadf3
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfdaab7cb5
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eebd992243
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 803f17a4f2
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 260ca6e72f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 34ab84b42f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2aefe3ccbe
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9921337dac
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec69fbe61f
ℹ️ 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".
|
@codex review |
|
@codex review Please review exact head 624d18e. Focus on the final ordering contract: initial producer verification, build/stage, final producer verification, live receipt reload and normalized-entry comparison, then replacements while holding the receipt guard. Check nested provider/remote freshness transitions, unchanged receipt identity, atomic cleanup, and null/legacy compatibility. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3536ebac1
ℹ️ 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".
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review Please review exact head 5f841ef. Focus on both final closeout repairs: producer verification before the live security reload/comparison, and unborn linked-worktree HEAD normalization. Confirm null is accepted only for unknown/coordinator semantics, observed/local/selected and serialized zero OIDs remain fail-closed, and the real-Git regression is producer-shaped. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Verification
ba3000833f1cd9c89442948ebe51f7e405e7832333a69c6f7347fb2fbfae254a5485d29de66481b8ba008141235f2ebbdd6a3e6d6a169356331cc34c686d1561e1e3a76ebf2245846842f8bb6a7a17a598f2d1baa2f5d980eca8fddd72e534245f841ef961952eed9ee976b0530612c96b58d1c6; the fresh automated review found no major issuesReview follow-up
The initial automated review correctly found array-shaped inputs/exclusions. Commit
3d16ed6replaced them with production-shaped mappings and added exact producer assertions.The next review correctly found partial producer evidence. Commit
1092128added a serialized-payload gate, replaced synthetic partial evidence with canonical empty evidence, pinned that boundary, and added positive/negative regressions.The same review also correctly found stale committed demo truth files. Commit
547e6e4regenerated all ten latest/history artifacts through the public-safe builder and added committed-artifact validation.The following review correctly found that envelope-only validation admitted impossible project rows. Commit
a1e4d3cmade the raw gate construct canonical snapshot/project types, run the unchanged full validator, align demo context and operating-path semantics, and prove malformed rows fail.The next review correctly found that reconstruction discarded serialized rollups and default-filled omitted fields. Commit
b73b9e1compares the supplied artifact to canonical serializer output after stripping only the two documented canaries; deleted/tampered rollups, tamperedopen_high_critical, and omitted project/security fields now fail with exact mismatch paths. The demo builder canonical-generates snapshots before the contract fixture adds canaries.The exact-head review and independent audit then found contradictory demo risk counts. Commit
dc8dddbmakes demo risk factors,security_risk, elevated tiers, and rollup denominators use the canonical Dependabot-only high/critical definition, with a whole-portfolio agreement regression.The subsequent exact-head review correctly found that the synthetic stale row was only six hours old at the fixed evaluation clock. Commit
c20bddfemits stale receipt timestamps 25 hours before snapshot generation, pins the portable row at 31 hours old during evaluation, and adds demo-wide plus manifest-clock regressions.The next exact-head review correctly found that stale rows discarded normalized provider evidence. Commit
88b89capreserves exactly the three production provider envelopes with stale states and cleared counts, compares them to the production provider constructor, and round-trips the full block through_build_security_fields.The following exact-head review and independent audit found that provider dictionaries still passed as opaque data and that fresh classifications were non-production values. Commit
bfdaab7validates receipt-backed provider sets, normalized envelope fields, states, reason codes, count shapes, completion, classifications, top-level counts, and coverage agreement; observed HTTP 200 demo providers now emitsuccess.The same review found non-production category tags and an invalid active-infra derivation. Commit
bfdaab7maps demo rows to valid categories, reservesactive-infrafor infrastructure andactive-productfor commercial, and fails invalid category/attention combinations.The next exact-head review correctly found that receipt-backed fixture rows omitted producer repository-state evidence. Commit
3cf2358adds producer-shaped observed repository state, receipt-normalized fresh/stale remote-default-branch evidence, nested branch positive/negative coverage, and private-path regressions.The independent exact-head audit also found that normalized provider envelopes still admitted impossible unavailable, stale, and no-receipt shapes. Commit
3cf2358extracts a shared semantics-preserving normalized-provider validator used by production receipt normalization and the portable consumer gate; a positive matrix covers every legitimate production provider state and negative cases pin HTTP, conditional, timestamp, classification, pagination, counts, completion, and receipt agreement.The next independent audit found that repository-state validation was still shallow. Commit
7c18a89validates exact state-dependent local/worktree/topology shapes, timestamps, OIDs, dirty/upstream semantics, topology counts and coordinator state, producer-recomputed selection, overall state/local/reason coherence, normalized remote agreement, and portable path/identity binding. The negative matrix pins every previously accepted attack, while a live bare-coordinator producer result proves constructor compatibility.The exact-head review also found that unconditional rejection of receiptless providers broke the documented legacy security-overlay path. Commit
7c18a89accepts only the exact producer-emitted legacy envelope and verifies provider/top-level agreement; normalized receipt-shaped impostors still fail. An end-to-end legacy build, validate, and publish regression plus tamper matrix pins the distinction.The residual contract audit found several remaining evidence-shape gaps. Commit
3cb837cmakes unattested security metadata exact, requires receipt-backed cohort membership, rejects explicit null bare-local state, pins outer observation time to snapshot generation, validates exact 40/64-character local Git identities plus branch/upstream shapes, recursively rejects private user paths, and pins the stable worktree-observation failure reason. Positive producer-shape regressions preserve bare coordinator and linked-worktree selection behavior.The latest exact-head review correctly found that repository normalization still hardcoded a 24-hour receipt age. Commit
3cb837cpropagatesSecurityCoverageReceiptBinding.max_age_hoursthrough publication validation, keeps 24 hours as the compatibility default, and proves approximately 30-hour remote evidence publishes under a 48-hour binding but fails under 24 hours.The exact-
3cb837cresidual audit found that the configured window reached remote normalization but not receipt or provider validation, and that Git token, cohort, identity, and privacy checks still admitted impossible shapes. Commit4b1694cthreads the explicit validation context through serialized and in-memory security validation; pins fresh, stale, unavailable, and configurable-window semantics; shares Git SHA and ref-format helpers across local and remote evidence; requires the production receipt cohort while preserving typed legacy cohorts; binds non-Git identities tonot_a_repository; and recursively rejects private paths and email identities across the full portable payload. Git grammar tests compare directly withgit check-ref-format.The same exact-head review correctly found that the portable fixture still emitted a reduced coverage envelope. Commit
0d3c590extracts the production coverage calculation into one shared contract used by live reconciliation, demo and fixture generation, and canonical validation. The gate now reconstructs exact workspace, git, full GitHub-security, Notion, and supplementary coverage rows and rejects missing rows, reduced fields, or tampered provider, remote, and cohort counts. The fixture, manifest, and ten affected demo truth snapshots were regenerated at their existing clocks.The exact-
0d3c590residual audits found that top-level precedence/source/input/exclusion/warning envelopes, nested dataclass types, and project risk/attention decisions could still drift while aggregate rollups remained plausible. Commit26de385extracts shared precedence, metadata, risk, and attention contracts; recomputes them during validation; requires exact nested runtime types and producer ordering; requires complete GitHub input metadata for receipt-backed rows; binds producer commits; tightens normalized provider and remote reasons; expands portable privacy checks; and adds a precisely marked synthetic cross-receipt fixture context while retaining singleton-strict live validation. The fixture, manifest, and ten demo truth snapshots were regenerated at their existing clocks.Exact-head CodeQL then identified the now-obsolete private
_attention_state_forcompatibility alias. Commiteebd992removes that dead production import/alias and points the focused policy tests directly at the sharedderive_attention_state()helper; Ruff, diff check, and the four relevant attention/risk tests pass.Exact-head residual audits then found reason-domain, provenance-binding, exclusion-domain, and privacy gaps. Commit
803f17apins provider and remote reasons to producer paths; makes remote constructors self-validate; requires the exact synthetic marker plus absent producer evidence and portable receipt identities; binds ProducerEvidence receipts to exact serialized identity material; restricts exclusions to positive producer reasons; and expands portable privacy coverage. Hostile Kestrel, receipt-tamper, timestamp, exclusion, and privacy regressions now fail closed.The next validated review pass found conditional-outcome, local-upstream, stale-remote-timestamp, and receipt-delimiter gaps. Commit
260ca6epins provider conditional request/result combinations to producer-reachable state/status/reason paths; accepts Git-produced bare local-branch upstream names while preserving divergent-branchUNKNOWN; requires timestamps on stale remote evidence; and replaces delimiter-ambiguous ProducerEvidence receipt material with canonical JSON plus control-free identity validation. Exact hostile portable, real-Git, constructor, timestamp, and collision regressions cover all four repairs.The next exact-head review correctly found that demo and contract path fields still used a non-production heuristic. Commit
34ab84broutes every demo row throughbuild_operating_path_entry(), feeds its path and override into the shared decision helper, and pins both every-row parity and the selected four-row matrix.The same review found empty fixture provenance and an unversioned incompatible producer-evidence digest. Commit
34ab84badds a shared required provenance-key contract derived from production-unconditional fields, meaningful public-safe nested demo provenance, hostile missing-provenance rejection, and production-project parity. It also bumps producer evidence toghra_producer_preflight.v3, requires exactly the four passing checks, binds observed and expected repository identity into the receipt, canonical-revalidates in-memory evidence, and rechecks live origin, ref-to-commit, HEAD, checkout path, and cleanliness before publication. Rewritten failed receipts, missing refs, origin drift, and direct forged objects fail closed.The fresh exact-head review then found that abbreviated upstream display remained ambiguous for slash-containing local branches. Commit
2aefe3crecords an explicit exactupstream_branchfrom the current branch merge ref, uses it for divergence, and validates exact local/remote display relationships. Real Git regressions prove matching localfeature/fooand remoteorigin/feature/foostay observed whilefootracking localfeature/fooremainsUNKNOWN; tampered serialized branch identity fails. The fixture, manifest, and ten demo snapshots were regenerated at their existing clocks.An independent exact-
2aefe3caudit found that validation still inferred remote identity from a display suffix. Commit9921337serializes exactupstream_remotefrom the current branch configuration alongside the display and exact merge branch. Local tracking requiresupstream_remote: "."and display equality; named remotes require exact<remote>/<branch>equality with public-safe Git grammar. No-upstream rows carry all three identity fields as null. Real Git coversoriginand slash-namedteam/origin; hostile branch repartition, remote grammar, and local/worktree parity mutations fail. The same twelve artifacts were regenerated at their existing clocks.The fresh exact-
9921337review found that receipt age was rounded before later live status work and then compared exactly against a newer snapshot clock, and that custom fetch refspecs could make Git's resolved tracking display differ from the configured remote/branch identity. Commitec69fbethreads one explicit security evaluation clock from receipt loading through snapshot validation, derives state from unrounded age, clamps tolerated future skew to serialized zero, retains the separate live pre-write freshness guard, and requires explicit clocks only for receipt-backed publication. It also keeps the resolved tracking ref for ahead/behind calculations while serializing the exact configured upstream identity, with real-Git custom-refspec coverage and exact stale/skew boundary regressions. Legacy receiptless overlays and non-security timestamp semantics remain unchanged.Two independent pre-commit audits found and closed scope leaks in the first draft of that repair: legacy alert-only publication does not require the receipt clock, and non-security CLI publication continues to take its timestamp at snapshot construction.
The fresh exact-
ec69fbereview correctly found that nested provider or remote evidence could cross its freshness boundary while the top-level receipt remained fresh. Commitd3536ebexact-compares the live reloaded normalized evidence with the snapshot-bound evidence before any target replacement and fails atomically on drift. A deterministic boundary regression keeps the same receipt bytes and identity fresh while provider and remote observations move from observed at exactly 24 hours to stale 500 milliseconds later; registry/report sentinels and latest/history outputs remain untouched. Focused publication tests, full Ruff, and all 3,333 tests pass.An independent exact-
d3536ebaudit then found that the final producer Git currentness check still ran after the live security reload and could consume the remaining nested-freshness window. Commit624d18emoves that final producer check immediately before guard entry, making the live receipt reload and normalized-entry comparison the final time-sensitive gate before replacements. The regression advances a controlled clock during producer verification #2, requiresverify-1 -> verify-2 -> guard-enter -> guard-exit, proves unchanged receipt identity and bytes, and confirms atomic cleanup. Nine focused tests, 472 relevant tests, full Ruff, the contract generator check, and all 3,333 tests pass.A late automated review bound to
d3536ebfound an applicable producer/validator mismatch that persisted through624d18e: Git emits an all-zero HEAD for a valid unborn linked worktree, the producer preserved it in an unknown entry, and the validator rejected it. Commit5f841efnormalizes only 40- or 64-character all-zero porcelain HEAD sentinels to null and permits an optional head only for unknown worktrees; observed, local, selected, and hostile serialized zero OIDs remain invalid. A real-Git orphan-worktree regression derives the active object width from porcelain, validates the normalized producer state, and rejects reintroduced zero. Repository-state/contract tests (207), full Ruff, the generator check, and all 3,334 tests pass.Claim limits
produced_atand state across every receipt-backed row.SecurityFieldsdoes not carry source repository identity. The validator binds each row's decisions to that row's normalized counts and binds aggregate input provenance, but it cannot detect swapping otherwise valid security envelopes between repository rows. Closing that attribution gap requires a future schema field and is not claimed here.supp:prefix; no stronger discovery-origin attribution is claimed.Coordination
This producer PR must merge before the paired PortfolioCommandCenter consumer PR. The consumer must be repinned to the immutable merged producer commit and rerun its CI before approval.
Known gate
The frozen canonical PortfolioTruth publication command was attempted and refused with
Canonical publication requires validated producer evidence.This feature worktree is intentionally not the validated canonical producer checkout; fixture generation and all code/contract gates passed.