Skip to content

Linking containment: prove a stray PR link cannot reach a closing state #10140

Closed

Description

@dezren39

Linking containment: prove a stray PR link can no longer reach a closing state

Part of the close-authority epic (automation must never close an issue).

Problem

Kaneo v2.47.0 links PRs to tasks loosely: any #n in the PR title, a closing-keyword body ref, a branch-pattern match, or a Kaneo task key (utils/issue-references.ts). We cannot patch upstream; the design decision is containment — with the sync guard (slice 1) ensuring no PR/branch transition can target a closing state, a stray link's worst case is a task moving to in-review/in-progress.

Work

  • Fixture battery on developing-today/code, all verified from issue timelines:
    1. Refs-only PR (body Refs #n, no keyword) on a plain issue → stays open, no status:done.
    2. Refs-only PR on a fixture epic with an open child → stays open, no status:done.
    3. Title-ref-only PR (title contains (#n), body clean) → no close, no status:done.
    4. Closes #n PR → closes natively; Kaneo completes the task and applies status:done after.
    5. Human close on GitHub → Kaneo task completes (fallback) — and the reverse, a deliberate human Done move in Kaneo → issue closes (documented wanted sync).
  • Record results in pm-stack/KANEO-GITHUB-SYNC.md (fixture section) so the battery is re-runnable after any Kaneo upgrade or re-connect.

Acceptance

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Fixture battery executed 2026-11-14 — results (timelines + Kaneo DB read-backs):

    1. Refs-only, plain issue — fixture: close-authority battery — refs-only plain issue #10197 ← PR fixture: refs-only plain probe #10216 merged 17:01:53Z → OPEN, no status:done, zero close events. (Body-only Refs formed no Kaneo link: no external_link row.)
    2. Refs-only, epic with open child — fixture: close-authority battery — refs-only epic parent #10199 (child fixture: close-authority battery — child of refs-only parent (stays open) #10205) ← PR fixture: refs-only epic probe #10218 merged 17:02:30Z → OPEN, no status:done, zero close events.
    3. Title-ref only — fixture: close-authority battery — title-ref target #10201 ← PR fixture: title-ref probe (#10201) #10220: link formed (bot status:in-review 17:01:50Z), merged 17:02:35Z → OPEN, no status:done. Loose linking is live; the merge transition now lands on in-review, so it cannot close.
    4. Closes keyword — Kaneo sync guard: repo-declared statusTransitions, asserted at deploy + hourly #10137 ← PR pm-stack: close authority — sync guard + design record (#10136) #10190 (Closes #10137) merged 17:04:11Z → closed natively by dezren39 17:04:13Z, bot status:done 17:04:17Z. Legit path intact.
      5a. Human close on GitHub — fixture: close-authority battery — refs-only plain issue #10197 closed by dezren39 17:06:26Z → linked Kaneo task read back as done in the DB.
      5b. Human Done move inside Kaneo — not run: Kaneo's apikey table is empty and minting a key is a UI action (no browser in this pass); a raw DB status change would bypass the app's sync layer and prove nothing. Covered by design (program note P2(iii)) + the 2026-10-24 setup proof. This is the one acceptance item left open on this slice.

    Battery recorded in pm-stack/KANEO-GITHUB-SYNC.md (PR #10287, merged) so it is re-runnable after any Kaneo upgrade or re-connect. All fixture issues closed as fixtures-complete; all fixture branches deleted.

  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Fixture 5b executed 2026-11-14 — PASS. This was the last open acceptance item; all five fixtures now pass.

    Dedicated automation account (new): Kaneo user Muse Automation (claude-automation@developing-today.local), created directly in Postgres per Drew's instruction — password credential hashed with Kaneo's own bcryptjs (bcrypt.hash(pw, 10), byte-format-identical to the existing admin row), workspace role owner in Developing Today. Sign-in proven through the real auth path (POST /api/auth/sign-in/email → session issued, active workspace Developing Today). API key muse-pm-automation minted via the better-auth api-key endpoint and verified with authenticated reads (get-session, project read). Credentials are stored ONLY in fleet secrets, by name: kaneo.muse-automation-password and kaneo.api-key-muse-automation (round-trip hash-verified).

    5b run: fixture issue #10308 → auto-imported as Kaneo task CODE-3715 (glhw6sgbe0xi85hwbfqvced4), linked via external_link. Task moved to Done with the API key only (PUT /api/task/status/:id, 200).

    • First attempt failed: bot applied status:done (17:39:50Z) but the issue never closed; the closure watchdog then stripped the orphaned label (17:42:27Z) as contradictory state.
    • Root cause (new defect, fleet-wide): Kaneo 2.47.0's outbound field sync (syncLatestTaskValue — issue state/title/description) string-compares integration.config text against JSON.stringify(JSON.parse(config)) and silently aborts on any byte difference. The jsonb_set(...)::text writes used by the containment fix — and by the sync guard's heal — leave jsonb-spaced text, so outbound state sync was dead on all four GitHub integrations while label sync (parsed comparison) kept working and masked it.
    • Fix (config first, per this issue's acceptance): all four configs rewritten semantically identical in compact JSON.stringify form (verified byte-equality + parsed deep-equality + guard conform). kaneo-sync-guard.py now treats non-compact config text as drift and rewrites it compactly after healing — live-verified both ways (induced format drift on the nix integration → DRIFT + HEALED, exit 1).
    • Re-run: task cycled In Review → Done via API key; bot status:done 17:51:20Z, issue closed by developing-today[bot] 17:51:21Z; Kaneo link metadata records the outbound state sync (lastSync.state.source=kaneo, value=closed); close stable across a full closure-watchdog sweep (still CLOSED, label intact, no reopen).

    Recording: doc + guard changes in PR #10316 (fixture table 5b row, config-format section, caution on the re-apply SQL, automation-account record). Fixture cleanup: #10308 closed as fixture-complete (its expected end state), no fixture branches existed; CODE-3715 remains Done. Closing this issue — its own task completing via the GitHub→Kaneo fallback is one last live confirmation of 5a.

  4. added a commit that references this issue on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions