Repository navigation
fix(promptcontract): own provisioning inputs and clean publication losers - #959
Gajesh2007 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head ( |
Prompt artifact work now owns the inputs it retains, validates every joining manifest, and removes its staging directory when another cache instance publishes first. Previously caller mutation could change a queued contract's files or configured origin, an invalid follower could reuse a valid leader's result without aggregate verification, and a publication loser could retain read-only temporary directories.
The API currently builds fresh manifests; the mutation fixtures demonstrate ownership-contract defects, not an observed production incident. Catalog reconciliation now clones nested file lists, cache construction snapshots the validated origin, and each caller checks its own aggregate before singleflight. Publication losers use the existing scoped writable cleanup and preserve the immutable winner. The supervisor's duplicate backoff branches and preload's repeated unavailable-state clearing are consolidated without changing their policies. Production source is +4 lines overall; the improvement is explicit ownership and less repeated control flow.
flowchart TB subgraph Before B1[Caller-owned URL and manifest file list] --> B2[Cache and Provisioner retain aliases] B2 --> B3[Later mutation can change download or contract path] B4[Ensure follower] --> B5[Join before aggregate verification] B6[Publication loses race] --> B7[Ignore removal error and skip deferred cleanup] B7 --> B8[Read-only staging can remain] B9[runChild ran flag] --> B10[Two identical backoff branches] end subgraph After A1[NewArtifactCache and Reconcile] --> A2[Own URL value and each file list] A2 --> A3[Stable origin and queued contract identity] A4[Ensure each caller] --> A5[Validate aggregate then join] A6[Publication loses race] --> A7[Verify winner and defer owned staging cleanup] A7 --> A8[Immutable winner retained; duplicate removed] A9[runChild lifecycle result] --> A10[One unchanged backoff path] endValidation on Go 1.25.0:
go test -race ./promptcontract -count=1: PASS, 4.177s. Includes existing endpoint/hash vectors, cancellation, socket client, provisioning, preload and synthetic supervisor-child tests.go test -race ./api -run '^TestCatalogReconcileProvisionsPromptArtifacts$' -count=1: PASS, 1.681s.scripts/docs-check.sh: PASS, 278 files.git diff --check: PASS.Source reviewed: all nine assigned Go artifact/client/endpoint/preload/provisioner/date/supervisor operation files and direct tests; unchanged endpoint lowering and hash fixtures preserve their existing byte contracts. Canonical documentation is stamped against reachable source commit
4a3c92016.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.