feat(gatorwalk-factory): mark a duplicate and move its work to the primary (swamp-club #2799) #422

Merged
seth merged 3 commits from cue/2799-gatorwalk-factory-mark into main 2026-10-01 18:30:37 +00:00
Owner

Closes swamp-club #2799: mark a duplicate and move its work to the primary.

The engine decides where a duplicate's work goes, and the tracker projects that decision. The tracker never reads engine state to decide an engine move (agreed in triage).

What changed

  • Agent path. A stage's new tracker.duplicate (on: { approve: <gate> }, record, field) names a human-approval gate and the product that holds the primary. When publish delivers the approval, it relates the ticket duplicate_of the primary and closes it.
  • Person path. A new mark_duplicate method on every tracker relates and closes, and moves no work. Linear closes a duplicate itself (closesDuplicates).
  • Work moves through the engine. If the primary has no work item, the driver runs retarget onto the primary. Otherwise it takes the definition's duplicate exit.
  • publish and claim refuse a duplicate ticket. This applies to a ticket marked outside the work item's journal. publish never writes a status to a duplicate, however it was marked.
  • claim and the ticket index. claim gains dryRun. publish moves the ticket index on every retarget, and claim treats a work item that was retargeted away as finished.
  • Examples. build-swamp-extension and starter gain a duplicate-of product and a duplicate exit behind duplicate-confirmation. A cel check closes that exit after a retarget. Each also gets a terminal duplicate stage and two scenarios.
  • Found on the way. A publish that crossed a retarget wrote the cursor twice in one run, which the real engine refuses. publish now reports one handle per record name.
  • Docs. The driving skill, README and DESIGN.md (a Duplicates section and a decision-log entry) are updated.

Testing

  • Unit tests: 739 pass.
  • Conformance: duplicate checks run against the built-in tracker, the Lab fake and the Linear fake.
  • End-to-end: a new built-in-tracker test on the real swamp CLI.
  • Scenarios for both moves.
  • verify-build and verify-reviews pass on 3b2e5a088b (attestation c6fac017-c51d-406c-b9e0-25b11ce494fe). Findings from the earlier review rounds were fixed before attesting.

Out of scope: the issue's line about superseding a held linked-issues draft from #2765. No such draft was found.

🤖 Generated with Claude Code

Closes swamp-club #2799: mark a duplicate and move its work to the primary. The engine decides where a duplicate's work goes, and the tracker projects that decision. The tracker never reads engine state to decide an engine move (agreed in triage). ## What changed - **Agent path.** A stage's new `tracker.duplicate` (`on: { approve: <gate> }`, `record`, `field`) names a human-approval gate and the product that holds the primary. When `publish` delivers the approval, it relates the ticket `duplicate_of` the primary and closes it. - **Person path.** A new `mark_duplicate` method on every tracker relates and closes, and moves no work. Linear closes a duplicate itself (`closesDuplicates`). - **Work moves through the engine.** If the primary has no work item, the driver runs `retarget` onto the primary. Otherwise it takes the definition's `duplicate` exit. - **`publish` and `claim` refuse a duplicate ticket.** This applies to a ticket marked outside the work item's journal. `publish` never writes a status to a duplicate, however it was marked. - **`claim` and the ticket index.** `claim` gains `dryRun`. `publish` moves the ticket index on every retarget, and `claim` treats a work item that was retargeted away as finished. - **Examples.** `build-swamp-extension` and `starter` gain a `duplicate-of` product and a `duplicate` exit behind `duplicate-confirmation`. A `cel` check closes that exit after a retarget. Each also gets a terminal `duplicate` stage and two scenarios. - **Found on the way.** A `publish` that crossed a retarget wrote the cursor twice in one run, which the real engine refuses. `publish` now reports one handle per record name. - **Docs.** The driving skill, README and DESIGN.md (a Duplicates section and a decision-log entry) are updated. ## Testing - Unit tests: 739 pass. - Conformance: duplicate checks run against the built-in tracker, the Lab fake and the Linear fake. - End-to-end: a new built-in-tracker test on the real swamp CLI. - Scenarios for both moves. - verify-build and verify-reviews pass on 3b2e5a088bff829d74485043a03cd0ca3aa87a3c (attestation c6fac017-c51d-406c-b9e0-25b11ce494fe). Findings from the earlier review rounds were fixed before attesting. Out of scope: the issue's line about superseding a held linked-issues draft from #2765. No such draft was found. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The engine decides where a duplicate's work goes; the tracker projects it.

- A stage's tracker.duplicate names a human-approval gate and the product
  holding the primary; publish marks the ticket duplicate_of the primary and
  closes it when it delivers the approval. A marked ticket stays closed.
- mark_duplicate on every tracker: a person relates and closes, moving no
  work. Linear closes a duplicate itself (closesDuplicates).
- publish and claim refuse a ticket marked a duplicate outside the work
  item's journal, naming the primary and the moves.
- claim gains dryRun; publish moves the ticket index on every retarget, and
  claim treats a work item retargeted away as finished.
- build-swamp-extension and starter: a duplicate-of product, a duplicate
  exit behind duplicate-confirmation (cel-closed after a retarget), a
  terminal duplicate stage, and scenarios for both moves.
- publish reports one handle per record name: crossing a retarget wrote the
  cursor twice, which the real engine refuses.
- Driving skill, README and DESIGN.md document both paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
publish now resolves each duplicate mark's primary before it decides a
segment's status. A mark with no product recorded before the approval, no
primary in its field, or the ticket itself as primary (an approval after the
retarget onto it) marks nothing and leaves the status writes alone, with a
warning. Found by the adversarial review in verify-reviews.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fix(gatorwalk-factory): a duplicate is never reopened, and an unknown primary never blocks publish (swamp-club #2799)
All checks were successful
CI / Review Integrity (pull_request) Successful in 1m0s
CI / Validate Attestation (pull_request) Successful in 1m2s
3b2e5a088b
From the second verify-reviews pass:

- publish reads a ticket before a status write and leaves a duplicate's
  status alone however it was marked, so a person's mark is not reopened
  by the old ticket's segment after a retarget.
- A mark's primary is fetched only when the mark is delivered; one the
  tracker cannot find marks nothing, with a warning, instead of failing
  every later publish.
- Marking checks the closed status mapping before it writes anything.
- The example duplicate exit says which externalRefs key its cel gate
  reads, for definitions written for Linear.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seth force-pushed cue/2799-gatorwalk-factory-mark from 3b2e5a088b
All checks were successful
CI / Review Integrity (pull_request) Successful in 1m0s
CI / Validate Attestation (pull_request) Successful in 1m2s
to fdb680c722
All checks were successful
CI / Review Integrity (pull_request) Successful in 49s
CI / Validate Attestation (pull_request) Successful in 58s
2026-10-01 18:28:48 +00:00
Compare
seth merged commit 6da7cacbc2 into main 2026-10-01 18:30:37 +00:00
seth deleted branch cue/2799-gatorwalk-factory-mark 2026-10-01 18:30:38 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!422
No description provided.