Skip to content

feat(portfolio): add contract-linter producer and shadow checks#169

Merged
saagpatel merged 1 commit into
mainfrom
feat/producer-preflight-contract-checks
Jul 11, 2026
Merged

feat(portfolio): add contract-linter producer and shadow checks#169
saagpatel merged 1 commit into
mainfrom
feat/producer-preflight-contract-checks

Conversation

@saagpatel

@saagpatel saagpatel commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • add minimized contract fixtures and schema 0.8 producer/input envelope
  • add read-only producer preflight and canonical publication refusal hooks
  • add opt-in semantic shadow checks with fail, warn, and unknown outcomes
  • preserve schema 0.7 compatibility while detecting declaration drift in historical artifacts

Verification

  • uv run ruff check .
  • uv run pytest -q: 2840 passed, 2 skipped
  • historical shadow evaluation: July 8 08:23 and 08:54 have no semantic failures; July 8 09:00, July 9, and July 10 fail CL-DECL-001 on exactly six stale projects

Boundaries

  • no generated portfolio artifacts changed
  • no scheduled automation, bridge, or Notion writes
  • shadow checks remain opt-in

@saagpatel saagpatel changed the title feat(portfolio): add producer preflight contract checks feat(portfolio): add contract-linter producer and shadow checks Jul 11, 2026
@saagpatel saagpatel marked this pull request as ready for review July 11, 2026 03:01
@saagpatel saagpatel merged commit 156bebe into main Jul 11, 2026
4 checks passed
@saagpatel saagpatel deleted the feat/producer-preflight-contract-checks branch July 11, 2026 03:02

@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: 052ed8aa8b

ℹ️ 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".

continue
identity = project.get("identity")
path = identity.get("path") if isinstance(identity, dict) else None
entry = repos.get(path) if isinstance(path, str) else None

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 Normalize catalog keys before declaration parity

Because load_portfolio_catalog normalizes repo keys via _normalize_key, while portfolio truth identity.path preserves the original case/path, this exact lookup skips normal catalog entries such as AIGCCore from config/portfolio-catalog.yaml after it is loaded as aigccore. In those cases CL-DECL-001 never inspects provenance, so a stale artifact that dropped catalog_repo declarations can pass the shadow check; resolve entries with the same normalization/catalog matching path the producer uses.

Useful? React with 👍 / 👎.

Comment thread src/producer_preflight.py
Comment on lines +98 to +99
current = _git(repo_root, "rev-parse", "HEAD")
if current != evidence.commit:

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 Recheck producer cleanliness before publication

When preflight evidence was collected from a clean tree and a source/catalog file is edited before publish without changing HEAD, this revalidation still passes because it only compares rev-parse HEAD. publish_portfolio_truth(..., require_producer_evidence=True) then writes producer evidence with worktree_clean: true even though the artifact was built from a dirty checkout; rerun the porcelain cleanliness check here before accepting the evidence.

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