-
Notifications
You must be signed in to change notification settings - Fork 0
fix: make Delivery and GitHub status cards truthful #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0369af7
fix: make delivery and GitHub status cards truthful
Codename-11 b45834f
fix: preserve stronger GitHub relations
Codename-11 86f6b08
fix: reconcile merged PR completion evidence
Codename-11 6d8d96a
fix: preserve explicit GitHub relation intent
Codename-11 46a87ce
fix: scope GitHub status automation to implementation
Codename-11 b371462
fix: clarify issue delivery and activity evidence
Codename-11 7449591
chore: prepare v0.27.1 release
Codename-11 fa41fb9
test: scope delivery evidence assertions
Codename-11 aa2d4ee
fix: preserve github relation identity
Codename-11 d3088de
fix: preserve source sync semantics
Codename-11 b204d9b
fix: dismiss stale completion evidence
Codename-11 e9db3f5
fix: preserve relation cleanup and bare urls
Codename-11 389642e
fix: align source status and url tokenization
Codename-11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
prisma/migrations/20260716200000_delivery_github_relation_truth/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| -- AXI-117: make GitHub relations singular/truthful and expand delivery source | ||
| -- vocabulary without conflating invocation, transport, and runtime. | ||
|
|
||
| ALTER TYPE "WorkSessionSource" ADD VALUE IF NOT EXISTS 'MCP'; | ||
| ALTER TYPE "WorkSessionSource" ADD VALUE IF NOT EXISTS 'NATIVE_SESSION'; | ||
| ALTER TYPE "WorkSessionSource" ADD VALUE IF NOT EXISTS 'ISSUE_DISPATCH'; | ||
| ALTER TYPE "WorkSessionSource" ADD VALUE IF NOT EXISTS 'SCHEDULED'; | ||
|
|
||
| -- Release assembly PRs are containment evidence, not implementation PRs. | ||
| UPDATE "ExternalResourceLink" link | ||
| SET "kind" = 'RELEASES' | ||
| FROM "ExternalResource" resource | ||
| WHERE link."externalResourceId" = resource."id" | ||
| AND link."kind" = 'IMPLEMENTS' | ||
| AND resource."resourceType" = 'PULL_REQUEST' | ||
| AND ( | ||
| resource."title" ~* '^\s*release\s+v?[0-9]' | ||
| OR COALESCE(resource."metadata" #>> '{head,ref}', '') ~* '(^|/)release([-\/]|$)' | ||
| ); | ||
|
|
||
| -- Older rows could carry multiple semantic kinds for the same issue/resource. | ||
| -- Keep one deterministic relation before enforcing the native invariant. | ||
| WITH ranked AS ( | ||
| SELECT "id", | ||
| ROW_NUMBER() OVER ( | ||
| PARTITION BY "issueId", "externalResourceId" | ||
| ORDER BY | ||
| CASE "kind" | ||
| -- SOURCE is the durable identity used to de-duplicate imported | ||
| -- GitHub issues/PRs. Derived relations must not erase it. | ||
| WHEN 'SOURCE' THEN 0 | ||
| WHEN 'FIXES' THEN 1 | ||
| WHEN 'IMPLEMENTS' THEN 2 | ||
| WHEN 'RELEASES' THEN 3 | ||
| WHEN 'REVIEWS' THEN 4 | ||
| ELSE 5 | ||
| END, | ||
| "createdAt" ASC, | ||
| "id" ASC | ||
| ) AS rn | ||
| FROM "ExternalResourceLink" | ||
| ) | ||
| DELETE FROM "ExternalResourceLink" link | ||
| USING ranked | ||
| WHERE link."id" = ranked."id" AND ranked.rn > 1; | ||
|
|
||
| -- Reclassification and dedupe can both remove the last implementation link. | ||
| -- Any completion request left without implementation PR evidence is stale. | ||
| UPDATE "ActionRequest" request | ||
| SET | ||
| "status" = 'DISMISSED', | ||
| "resolvedAt" = NOW(), | ||
| "resolution" = 'No linked pull request remains as implementation evidence.' | ||
| WHERE request."status" = 'OPEN' | ||
| AND request."sourceType" = 'completion-candidate' | ||
| AND request."issueId" IS NOT NULL | ||
| AND NOT EXISTS ( | ||
| SELECT 1 | ||
| FROM "ExternalResourceLink" implementation_link | ||
| JOIN "ExternalResource" implementation_resource | ||
| ON implementation_resource."id" = implementation_link."externalResourceId" | ||
| WHERE implementation_link."issueId" = request."issueId" | ||
| AND implementation_link."kind" IN ('IMPLEMENTS', 'FIXES') | ||
| AND implementation_resource."resourceType" = 'PULL_REQUEST' | ||
| ); | ||
|
|
||
| DROP INDEX "ExternalResourceLink_issueId_externalResourceId_kind_key"; | ||
| CREATE UNIQUE INDEX "ExternalResourceLink_issueId_externalResourceId_key" | ||
| ON "ExternalResourceLink"("issueId", "externalResourceId"); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.