feat(portfolio): add reusable consumer contract profiles - #216
Conversation
There was a problem hiding this comment.
💡 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".
| and contract_fixture.get("contract_version") | ||
| in { | ||
| "ghra-pcc-portfolio-truth.v1", | ||
| "ghra-portfolio-truth-portable.v1", | ||
| } |
There was a problem hiding this comment.
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 👍 / 👎.
Scope
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
--checkRollout order
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.