Skip to content

Keep incomplete required foundation unpublished and resumable - #310

Merged
tzhouam merged 1 commit into
mainfrom
fix/kb-foundation-complete-publication-20261006
Oct 5, 2026
Merged

tzhouam merged 1 commit into
mainfrom
fix/kb-foundation-complete-publication-20261006

Conversation

@tzhouam

@tzhouam tzhouam commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

A required subscription foundation run could publish a partial, immutable PR while feature coverage was still incomplete. Switching a preview to publication also changes the frozen input identity, so neither path supports completing the same paid batch safely.

Keep unlimited-subscription publication blocked before preparing or pushing a PR until the required feature and production-file targets are met. The genuine foundation checkpoint retains its approved facets; rerunning the same pinned publication batch restores them, extracts only the missing facets, and publishes once coverage passes. This is an eight-line publication guard with no prompt, model, identity, or evidence-policy changes.

Validation: 109 relevant tests pass. A scripted native transport regression preserves 17 archived approval artifacts, blocks incomplete publication without creating a prepared file or PR, retries only one missing facet with two calls, and then publishes successfully. Compatibility cases cover finite runs, previews, optional policies, and completed targets. Doc citation scanning, SPEC freshness, and diff checks pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T20:16:55.156562Z 955d65b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 955d65b4b7

ℹ️ 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 +164 to +167
def _publish(self, changed: dict[str, str]) -> InitRecord:
targets = self.record.coverage.get("knowledge", {}).get("targets", {})
if (self.rt.unlimited_subscription and not self.dry_run
and targets.get("required") is True and targets.get("met") is not True):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Gate incomplete runs before the empty fast-path

Move this required-target check earlier than _publish: _Stage._conclude returns an empty record without calling _publish whenever changed is empty. If the merged base already contains contracts/feature metadata but a required facet remains missing and the generator or judge produces no approved replacement, an unlimited publication run therefore reports empty; knowledge.init treats that status as success and the CLI exits 0 despite targets.met being false. The incomplete-target gate must also cover this no-diff path.

Useful? React with 👍 / 👎.

@tzhouam
tzhouam merged commit a7923c3 into main Oct 5, 2026
1 of 2 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