Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .agents/pm/history/pm-github-rwq9.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{"ts":"2026-08-03T21:59:35.068Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"kimi-k3","agent_model_source":"environment","agent_instance":"0d29e597c3da0cc6b64f7e7d","agent_provenance":{"model":{"value":"kimi-k3","source":"environment"},"effort":null,"role":null,"topic":null},"op":"create","patch":[{"op":"add","path":"/metadata/id","value":"pm-github-rwq9"},{"op":"add","path":"/metadata/title","value":"Fix terminal transitions for pm-cli 2026.8.3 close_reason enforcement"},{"op":"add","path":"/metadata/description","value":"Upgrading @unbrained/pm-cli from 2026.7.29 to 2026.8.3 makes pm update --status closed a hard error (close_reason_required) because governance.require_close_reason is enforced. This package relied on the old auto-route bypass in its import and sync reconciliation paths. Route terminal transitions through pm close with real provenance reasons, pass completed-at where the source carries a timestamp, and bump the pm-cli pin to 2026.8.3."},{"op":"add","path":"/metadata/type","value":"Issue"},{"op":"add","path":"/metadata/status","value":"open"},{"op":"add","path":"/metadata/priority","value":2},{"op":"add","path":"/metadata/tags","value":[]},{"op":"add","path":"/metadata/created_at","value":"2026-08-03T21:59:35.068Z"},{"op":"add","path":"/metadata/updated_at","value":"2026-08-03T21:59:35.068Z"},{"op":"add","path":"/metadata/author","value":"pi-agent"},{"op":"add","path":"/metadata/acceptance_criteria","value":"npm run typecheck, npm run build, npm test, npm run coverage and npm run changelog:check all pass with @unbrained/pm-cli pinned at ^2026.8.3; the previously failing tests runImport reopens a linked item whose upstream issue was reopened and runSync --apply PATCHes GitHub to match pm status pass without editing test intent; no governance policy is disabled or weakened."}],"before_hash":"3cc22dff72be7b14824654a7a64ea62b04799939b2fee54c1b5f52ca60bf6df0","after_hash":"15012fd143ef2ccae4359e9e1b319b087f00bf99eb9459cabf86c5f5d7559573","message":""}
{"ts":"2026-08-03T21:59:43.858Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"kimi-k3","agent_model_source":"environment","agent_instance":"0d29e597c3da0cc6b64f7e7d","agent_provenance":{"model":{"value":"kimi-k3","source":"environment"},"effort":null,"role":null,"topic":null},"op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-03T21:59:43.858Z"},{"op":"replace","path":"/metadata/status","value":"in_progress"}],"before_hash":"15012fd143ef2ccae4359e9e1b319b087f00bf99eb9459cabf86c5f5d7559573","after_hash":"43be8f5ccacd0f677c17d20c40597c278e7c97110e06c2c52346141bcc2b4052"}
{"ts":"2026-08-03T21:59:57.994Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"kimi-k3","agent_model_source":"environment","agent_instance":"0d29e597c3da0cc6b64f7e7d","agent_provenance":{"model":{"value":"kimi-k3","source":"environment"},"effort":null,"role":null,"topic":null},"op":"claim","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-03T21:59:57.994Z"},{"op":"add","path":"/metadata/assignee","value":"pi-agent"},{"op":"add","path":"/metadata/claim_principal","value":"pi-agent"}],"before_hash":"43be8f5ccacd0f677c17d20c40597c278e7c97110e06c2c52346141bcc2b4052","after_hash":"918dbd5e83e72d9be0ad6bb25ad37c34cf3e31078c171bd6e49894f291fd630b"}
{"ts":"2026-08-03T22:20:57.761Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"50b044f32abe7b85e5073931","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"note_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-03T22:20:57.761Z"},{"op":"add","path":"/metadata/notes","value":[{"created_at":"2026-08-03T22:20:57.760Z","author":"pi-agent","text":"Root cause: two defects surfaced under pm-cli 2026.8.3 close_reason enforcement. (1) SOURCE: runImport's non-atomic create path issued `pm create --status closed` for new closed GitHub issues, which is now a hard close_reason_required error. Fixed by creating closed issues as open then closing via `pm close --reason`, mirroring the already-correct atomic path and the reconciliation path. (2) FIXTURE: the test helper createLinkedItem used the same `pm create --status closed` pattern; switched to create-then-close so the closed linked-item fixture still represents a genuinely closed item. Also threaded GitHub `closed_at` through GhIssue -> PreparedGithubImport -> every close site (create path, reconciliation, atomic close op) as --completed-at / completedAt so imported items keep their real completion time instead of import time."}]}],"before_hash":"918dbd5e83e72d9be0ad6bb25ad37c34cf3e31078c171bd6e49894f291fd630b","after_hash":"464deda7e9d74ee9b89e443e472a58d8eb6c66c9f6a77ff8b09c0db4b38c3150"}
{"ts":"2026-08-03T22:21:03.479Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"50b044f32abe7b85e5073931","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"close","patch":[{"op":"remove","path":"/metadata/assignee"},{"op":"replace","path":"/metadata/updated_at","value":"2026-08-03T22:21:03.479Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/closed_at","value":"2026-08-03T22:21:03.466Z"},{"op":"add","path":"/metadata/completed_at","value":"2026-08-03T22:21:03.466Z"},{"op":"add","path":"/metadata/close_reason","value":"Shipped: index.ts create path now routes new closed issues through create(open)+pm close --reason [--completed-at]; reconciliation close and atomic close op carry completedAt from GitHub closed_at; createLinkedItem fixture uses create-then-close. Verified: npm run typecheck (ok), npm run build (ok), npm test (239/239 pass incl. the two previously-failing tests), npm run coverage (index.ts 88.18% lines / 79.63% branches / 89.94% funcs, all thresholds met). No governance policy weakened; closed_at is read-only provenance from the source record."}],"before_hash":"464deda7e9d74ee9b89e443e472a58d8eb6c66c9f6a77ff8b09c0db4b38c3150","after_hash":"50dcb1366c33cd61bdbcf9cf6232a2bb85d414435b82a84b72ecd957efb51802"}
{"ts":"2026-08-03T23:09:31.421Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2:cloud","agent_model_source":"environment","agent_instance":"65d9708c9f7e99938905a9c3","agent_provenance":{"model":{"value":"glm-5.2:cloud","source":"environment"},"effort":null,"role":null,"topic":null},"op":"note_add","patch":[{"op":"add","path":"/metadata/notes/1","value":{"created_at":"2026-08-03T23:09:31.421Z","author":"pi-agent","text":"Follow-up sweep found two more defects the initial fix missed. (1) PRODUCT BUG: runProjectImport (the github project import handler) still issued pm create --status closed and pm update --status closed for project board items wrapping closed issues or carrying a board Status mapped to closed. Fixed both the create path (create open, then pm close --reason with factual provenance from the wrapped issue or project ref) and the update path (update without --status, then pm close --reason). This is a user-facing bug: importing a GitHub project with closed items would fail under pm-cli 2026.8.3. (2) LATENT BUG: parseCreatedItemId looked for parsed.item.id but pm create --json emits { id: ... } at the top level, so the create-then-close path in runImport could not read the new id and silently left the item open instead of closing it. Fixed to accept both parsed.id and parsed.item.id. Added two handler-level tests (closed issue create path, closed board-status update path) and updated the parseCreatedItemId unit test for the real emit shape. All 241 tests pass; coverage thresholds met."}},{"op":"replace","path":"/metadata/updated_at","value":"2026-08-03T23:09:31.421Z"}],"before_hash":"50dcb1366c33cd61bdbcf9cf6232a2bb85d414435b82a84b72ecd957efb51802","after_hash":"7280952e47bc2eff67c9fd8a42c03d340a4f3d186f0c03d5a12786d2ea242533"}
19 changes: 19 additions & 0 deletions .agents/pm/issues/pm-github-rwq9.toon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: pm-github-rwq9
title: Fix terminal transitions for pm-cli 2026.8.3 close_reason enforcement
description: "Upgrading @unbrained/pm-cli from 2026.7.29 to 2026.8.3 makes pm update --status closed a hard error (close_reason_required) because governance.require_close_reason is enforced. This package relied on the old auto-route bypass in its import and sync reconciliation paths. Route terminal transitions through pm close with real provenance reasons, pass completed-at where the source carries a timestamp, and bump the pm-cli pin to 2026.8.3."
type: Issue
status: closed
priority: 2
tags: []
created_at: "2026-08-03T21:59:35.068Z"
updated_at: "2026-08-03T23:09:31.421Z"
closed_at: "2026-08-03T22:21:03.466Z"
completed_at: "2026-08-03T22:21:03.466Z"
claim_principal: pi-agent
author: pi-agent
acceptance_criteria: "npm run typecheck, npm run build, npm test, npm run coverage and npm run changelog:check all pass with @unbrained/pm-cli pinned at ^2026.8.3; the previously failing tests runImport reopens a linked item whose upstream issue was reopened and runSync --apply PATCHes GitHub to match pm status pass without editing test intent; no governance policy is disabled or weakened."
notes[2]{created_at,author,text}:
"2026-08-03T22:20:57.760Z",pi-agent,"Root cause: two defects surfaced under pm-cli 2026.8.3 close_reason enforcement. (1) SOURCE: runImport's non-atomic create path issued `pm create --status closed` for new closed GitHub issues, which is now a hard close_reason_required error. Fixed by creating closed issues as open then closing via `pm close --reason`, mirroring the already-correct atomic path and the reconciliation path. (2) FIXTURE: the test helper createLinkedItem used the same `pm create --status closed` pattern; switched to create-then-close so the closed linked-item fixture still represents a genuinely closed item. Also threaded GitHub `closed_at` through GhIssue -> PreparedGithubImport -> every close site (create path, reconciliation, atomic close op) as --completed-at / completedAt so imported items keep their real completion time instead of import time."
"2026-08-03T23:09:31.421Z",pi-agent,"Follow-up sweep found two more defects the initial fix missed. (1) PRODUCT BUG: runProjectImport (the github project import handler) still issued pm create --status closed and pm update --status closed for project board items wrapping closed issues or carrying a board Status mapped to closed. Fixed both the create path (create open, then pm close --reason with factual provenance from the wrapped issue or project ref) and the update path (update without --status, then pm close --reason). This is a user-facing bug: importing a GitHub project with closed items would fail under pm-cli 2026.8.3. (2) LATENT BUG: parseCreatedItemId looked for parsed.item.id but pm create --json emits { id: ... } at the top level, so the create-then-close path in runImport could not read the new id and silently left the item open instead of closing it. Fixed to accept both parsed.id and parsed.item.id. Added two handler-level tests (closed issue create path, closed board-status update path) and updated the parseCreatedItemId unit test for the real emit shape. All 241 tests pass; coverage thresholds met."
close_reason: "Shipped: index.ts create path now routes new closed issues through create(open)+pm close --reason [--completed-at]; reconciliation close and atomic close op carry completedAt from GitHub closed_at; createLinkedItem fixture uses create-then-close. Verified: npm run typecheck (ok), npm run build (ok), npm test (239/239 pass incl. the two previously-failing tests), npm run coverage (index.ts 88.18% lines / 79.63% branches / 89.94% funcs, all thresholds met). No governance policy weakened; closed_at is read-only provenance from the source record."
body: ""
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# pm-cli:merge-drivers:start
".agents/pm/**/*.toon" merge=pm-item-toon
".agents/pm/**/*.md" merge=pm-item-markdown
".agents/pm/chores/*.toon" merge=pm-item-toon
".agents/pm/chores/*.md" merge=pm-item-markdown
".agents/pm/decisions/*.toon" merge=pm-item-toon
Expand Down
Loading