Skip to content

fix(skills): add blocked API journal flow#2806

Merged
mergify[bot] merged 4 commits into
mainfrom
fix/issue-2143-blocked-api-journal
Jun 7, 2026
Merged

fix(skills): add blocked API journal flow#2806
mergify[bot] merged 4 commits into
mainfrom
fix/issue-2143-blocked-api-journal

Conversation

@tmchow

@tmchow tmchow commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Intent

Closes #2143.

Held API attempts now have a shared path to prevent repeated wasted /printing-press runs. A future run can warn before rebuilding an API that the public library already records as held for a repeatable reachability or buildability blocker.

Approach

  • Extend the Phase 0 public-library check to fetch blocked-apis.json alongside registry.json, match only same-API slug or brand variants, and prompt before continuing when a held entry matches.
  • Add a hold-path menu option for repeatable reachability and buildability holds so the run can hand off a durable journal entry instead of only archiving local manuscripts.
  • Add a journal-only mode to /printing-press-publish that updates only blocked-apis.json in the public library and stops before normal printed-CLI package or registry flows.
  • Add pipeline contract tests that pin the new skill instructions and publish-mode boundaries.

Scope

Primary area: skills/printing-press and skills/printing-press-publish.

This belongs in the Printing Press because the bug is in the orchestration skills: fresh users had no shared preflight warning for known held APIs, and only the publish skill should touch public-library state.

Risk

The main risk is over-warning on a blocked journal entry. The Phase 0 instructions constrain matching to same-API slug or brand variants and explicitly avoid vague category or description matching.

Verification

  • go test ./internal/pipeline -run 'Test(PrintingPressSkillChecksBlockedAPIJournal|PublishSkillDocumentsBlockedAPIJournalMode|PublishSkillSkipsCliSkillsMirrorRegen)'
  • gofmt -w internal/pipeline/contracts_test.go
  • git diff --check
  • go test ./...
  • push hook: fmt, lint

@mergify

mergify Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 require-ready-label-and-ci

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0
  • check-success = build-and-test
  • check-success = generated-test
  • check-success = go-lint
  • check-success = golden
  • check-success = pr-title
  • check-success = test
  • any of:
    • label = ready-to-merge
    • all of:
      • head = release-please--branches--main
      • title ~= ^chore\(main\): release
  • any of:
    • -files ~= ^(\.github/workflows/|\.github/scripts/|scripts/|\.github/CODEOWNERS$)
    • author = tmchow
    • approved-reviews-by = mvanhorn
    • approved-reviews-by = tmchow
    • author = mvanhorn
  • any of:
    • check-success = Greptile Review
    • label = queued
    • check-neutral = Greptile Review
    • check-skipped = Greptile Review
    • head ~= ^mergify/merge-queue/
    • all of:
      • head = release-please--branches--main
      • title ~= ^chore\(main\): release

@greptile-apps

greptile-apps Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a shared blocked-API journal flow to the Printing Press skills, closing #2143. When an API attempt is held for a repeatable reachability or buildability blocker, users can now create a durable public-library journal entry so future runs warn before repeating the same dead-end attempt.

  • skills/printing-press/SKILL.md: Extends Phase 0 to fetch and check blocked-apis.json alongside registry.json, and adds an "Add to blocked-API journal" option to the hold-path menu with guardrails limiting it to repeatable blockers.
  • skills/printing-press-publish/SKILL.md: Adds --blocked-api-journal mode that updates only blocked-apis.json (not registry surfaces), using a safe jq-to-tmp-then-mv pattern with pre-move JSON validation.
  • internal/pipeline/contracts_test.go: Adds three contract tests that pin the new skill instructions and journal-mode publish boundaries.

Confidence Score: 5/5

Safe to merge — changes are confined to skill instruction files and contract tests with no runtime code paths altered.

The changes add a new opt-in journal flow with independent failure handling (fetch failures are logged and skipped, not blocking), correct jq-to-tmp-then-validate-then-mv write ordering, and tight staged-file scope enforced by both the skill text and a NotContains contract assertion. Previously flagged issues (suffix combining both permanent and tracking_issue, jq validation order, missing example) are all addressed in this diff.

No files require special attention.

Important Files Changed

Filename Overview
skills/printing-press/SKILL.md Phase 0 extended to fetch blocked-apis.json, match slugs, and prompt the user; hold-path menu gains a journal option with appropriate guardrails; tracking suffix correctly covers all four combinations of blocking_issue/permanent.
skills/printing-press-publish/SKILL.md Adds Blocked API Journal Mode: safe jq→tmp write with pre-mv JSON validation, correct staged-file scope (blocked-apis.json only), example added to the opening block, and a clear stop-before-normal-flow instruction.
internal/pipeline/contracts_test.go Three new contract tests pin the key instruction strings in both skill files; NotContains guard prevents accidental library/ staging alongside blocked-apis.json; all assertions match the current SKILL.md text.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["/printing-press <api>"] --> B["Phase 0: Local library check"]
    B -->|"No local match"| C["Fetch registry.json + blocked-apis.json"]
    C --> D{"blocked-apis.json\nfetch succeeded?"}
    D -->|"No / absent"| F["Log: journal check skipped\nProceed to registry check"]
    D -->|"Yes"| E{"Slug matches\nblocked entry?"}
    E -->|"No match"| F
    E -->|"Match found"| G["Prompt: API held — reason + tracking suffix\nStop here (recommended) / Proceed anyway"]
    G -->|"Proceed anyway"| F
    G -->|"Stop"| STOP1["End run"]
    F --> H["Registry check → Phase 1 research"]
    H --> I{"Ship result?"}
    I -->|"Ship"| SHIP["Promote + publish flow"]
    I -->|"Hold"| J["Hold-path menu\n1 Run retro\n2 Polish to retry\n3 Add to blocked-API journal\n4 Done for now"]
    J -->|"Option 3\n(reachability/buildability hold only)"| K["/printing-press-publish --blocked-api-journal <api>"]
    K --> L["Blocked API Journal Mode\nUpdate only blocked-apis.json via jq→tmp→mv\nCreate branch + PR"]
    L --> M["Report PR URL and stop\nNo registry / package / skill-mirror steps"]
Loading

Reviews (4): Last reviewed commit: "fix(skills): clean blocked journal temp ..." | Re-trigger Greptile

Comment thread skills/printing-press-publish/SKILL.md Outdated
Comment thread skills/printing-press/SKILL.md
@tmchow tmchow added the ready-to-merge Allow Mergify to queue and merge this PR when protections pass label Jun 7, 2026
mergify Bot added a commit that referenced this pull request Jun 7, 2026
@mergify mergify Bot added the queued PR is in the Mergify merge queue label Jun 7, 2026
mergify Bot added a commit that referenced this pull request Jun 7, 2026
mergify Bot added a commit that referenced this pull request Jun 7, 2026
@mergify mergify Bot merged commit 7d445b1 into main Jun 7, 2026
31 checks passed
@mergify mergify Bot deleted the fix/issue-2143-blocked-api-journal branch June 7, 2026 19:40
@mergify

mergify Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 34 minutes 53 seconds in the queue, including 34 minutes 38 seconds running CI.

Required conditions to merge

@mergify mergify Bot removed the queued PR is in the Mergify merge queue label Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Allow Mergify to queue and merge this PR when protections pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skill: shared blocked-apis journal — warn before re-building a held/unreachable API, promote to buildable when the blocking issue closes

1 participant