Skip to content

feat(portfolio): add reusable consumer contract profiles - #216

Merged
saagpatel merged 6 commits into
mainfrom
codex/spp01-multi-consumer-contracts-20260804
Aug 5, 2026
Merged

feat(portfolio): add reusable consumer contract profiles#216
saagpatel merged 6 commits into
mainfrom
codex/spp01-multi-consumer-contracts-20260804

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Scope

  • add one deterministic, public-safe PortfolioTruth artifact shared by two opaque consumer profiles
  • add producer-owned manifests for an operator control plane and a public-site projection
  • extend regeneration and validation so committed bytes, fixed clocks, additive canaries, malformed inputs, and fail-closed outcomes stay executable
  • preserve the existing PortfolioCommandCenter profile and its committed fixture bytes unchanged

Consumer evidence

Both downstream adapters and immutable locks are implemented in isolated consumer worktrees and pass their focused and full repository gates against the producer commit. The consumer repository identities remain intentionally absent from this public contract.

Compatibility policy

This is additive for PortfolioTruth 0.x. The producer remains the sole truth producer; consumers keep their own parser, product policy, immutable lock, and acceptance tests.

Verification

  • deterministic generator --check
  • 196 focused contract tests
  • 3,413 full tests passed; 2 skipped
  • Ruff passed on all changed Python surfaces
  • private-path and private-consumer-name scans are clean

Rollout order

  1. merge this producer PR
  2. pin downstream locks to the immutable producer merge SHA and the committed manifest/artifact digests
  3. rerun downstream CI and merge consumer PRs

Rollback

Revert the new portable fixture, manifests, and generator/validator additions. The legacy PortfolioCommandCenter contract is byte-stable and remains independently usable.

Non-goals

No shared runtime SDK, service, second truth producer, absolute sibling-checkout dependency, private live data, deployment, or runtime activation.

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

ℹ️ 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 +1655 to +1659
and contract_fixture.get("contract_version")
in {
"ghra-pcc-portfolio-truth.v1",
"ghra-portfolio-truth-portable.v1",
}

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 Guard malformed contract versions before membership

If a malformed contract artifact sets contract_fixture.contract_version to a JSON array or object, this set-membership check raises TypeError before the validator reaches its normal ValueError rejection path; I reproduced this by setting the portable fixture version to []. The profile manifests added in this change advertise malformed-input reject/fail-closed behavior, and the generator check only catches ValueError, so this can turn an incompatible artifact into a crashed contract gate instead of a controlled reject; validate that the version is a string before the membership test.

AGENTS.md reference: src/AGENTS.md:L5-L10

Useful? React with 👍 / 👎.

@saagpatel
saagpatel merged commit 87fbe84 into main Aug 5, 2026
4 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