Skip to content

feat(workspace): work kind contract link, tier, intent source, attempt limit, closed lease outcomes and kept attempts - #3298

Merged
lex00 merged 4 commits into
mainfrom
ws-3147-work-kind
Oct 3, 2026
Merged

lex00 merged 4 commits into
mainfrom
ws-3147-work-kind

Conversation

@lex00

@lex00 lex00 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The work kind gains the fields studio keeps under x-factory on work items, so a factory can read and write them through chant.

The work kind's work block takes four new optional entries. contract names the field holding the contract record an item builds and that contract's kind file; records --json gives each item contract { id, state } and warns work-contract-unknown or work-contract-undecided. tier names the item's tier field and lists the allowed tiers once; a tier outside them is warned work-tier-unknown. attempts names an item's own limit field and the kind's default max. answers names the answer kind, and records --json gives each item answers, every decision-point answer whose constrains holds the item's id, read from the tree and, in the working tree, from the answers a steward keeps on chant/lifecycle. The answer is joined by id and never copied onto the item.

The reference work schema adds contract, tier, max_attempts, result (only lease) and a fifth source form, source.intent { decision, question, answer, by, at }. The reference kind declares tiers small, medium and large, a default of 3 attempts, and the answer kind. It declares no contract link, since the reference workspace has no contract kind until #3148.

Lease outcomes are now a closed list in work-lease.schema.json: done, not_done, abandoned, gated, waiting, dropped, redraft and ask. work release --outcome refuses anything else with write-usage-invalid, and an Op whose step names a word outside the list is released not_done with a note. Only not_done and abandoned count as attempts, together with a release with no outcome or legacy free text, and a claim that expired or was lost. work history --json adds attempt and kept on each claim, attempts { failed, limit, remaining, exhausted } and kept on the document.

An Op that changes the checkout and ends not_done now keeps its attempt: committed and uncommitted work in the worktree is committed to refs/chant/kept/[/]/ and the work branch goes back to where the run started. The run result reports it in workLease.kept. Replicating those refs is #3172.

The new warning codes are in reason-codes.ts and in the records and intent schemas. Every addition is within contract 1. Docs: guide/work-items, cli/workspace-work, cli/workspace-records, cli/run, guide/ops and the read-contract page.

Verified with core tsc, targeted vitest (work, work history, the new work-kind-fields test, work lease and work-lease-run including the kept-attempt runs, reason codes, read contract, records, intent, points, status, the reference workspace test and the records goldens), the core unit suite, just docs-check and the docs prose ratchet.

Closes #3147

lex00 added 2 commits October 3, 2026 00:30
…t limit, closed lease outcomes and kept attempts

The work kind gains what studio kept under x-factory on work items. The
work block can name a contract kind, the builder tiers a workspace allows,
an attempt limit with a per-item override, and the answer kind whose
answers records joins onto each item by id. The reference schema adds
contract, tier, max_attempts, result.lease and a source.intent form.

Lease outcomes are a closed list. work history reports which claims count
as attempts, the item's attempts against its limit, and its kept attempts.
An Op that changes the checkout and ends not_done keeps its work at
refs/chant/kept/[<member>/]<item>/<token> and resets the work branch.
@lex00 lex00 added enhancement New feature or request area:workspace chant workspace epic (#2525) level:2 workspace opt-in level 2 (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain labels Oct 3, 2026
@lex00
lex00 merged commit 02c6de5 into main Oct 3, 2026
12 checks passed
@lex00
lex00 deleted the ws-3147-work-kind branch October 3, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace chant workspace epic (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain enhancement New feature or request level:2 workspace opt-in level 2 (#2525)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

work kind: contract link, tier, intent source, attempt limit, closed lease outcomes and kept-attempt refs, replacing studio's x-factory on work items

1 participant