Skip to content

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

Closed

Description

@lex00

Part of #3145.

Problem

Studio extends work items with x-factory fields and conventions the work kind doesn't define:

studio meaning location
x-factory.contract the contract the item builds; without it the item isn't factory work queue.mjs:226-246, dispatch.mjs:64
x-factory.tier builder tier override for an ask queue.mjs:115,187
x-factory.intent, .question marks the first build opened from the box's intent, dispatched once intent.mjs:55-80
x-factory.understand {question, answer, by, reason} the understand point's answer on the item record.mjs:107,208
x-factory.result {...} build provenance (outcome, lease, agent, model, tier, harness, session, evidence, check) record.mjs:132-150
attempt limit (FACTORY_ATTEMPTS, 3) stop building after N failed claims queue.mjs:209-261
lease outcomes dropped, redraft, ask, waiting release words that don't count against attempts queue.mjs:64, dispatch.ts:43-45
refs/factory/kept/<item>/<token>, refs/factory/dispatch/<item>/{base,work} parked unfinished attempts and fountain handoffs lib.mjs:288, dispatch.mjs:80, builder.mjs:30,295
x-studio block legacy design-app units, the only diff from the reference work.schema.json template/work/work.schema.json:163-420

(paths under template/box/ops/factory/ unless given)

chant today: work-history.schema.json leaves outcome free text and chant writes only done/not_done/gated/waiting (work-lease-run.ts:378); #2734 left the attempt limit to the runner.

Proposal

In the reference work kind and lease schemas:

  • implements (or similar) linking a work item to a contract record
  • tier, with the allowed tiers declared once
  • source.intent as a fifth source form
  • the decision-point answer joined by id from the answers kind, not copied onto the item
  • max_attempts, with a declaration default
  • a closed lease outcome vocabulary in work-lease.schema.json, including dropped, redraft, ask
  • a kept-attempt ref convention under refs/chant/ written by core when a lease ends not done
  • build provenance moves to the run record (workspace: record what each agent run cost and which changes it made #3033); the work item keeps only result.lease
  • x-studio on work is retired (studio migrates old boxes)

Activity

  1. added
    enhancement
    area:workspace
    level:2
    boundaries
    on Oct 1, 2026
  2. lex00 commented on Oct 3, 2026

    @lex00
    ContributorAuthor

    Design decisions in #3298.

    Tiers and the attempt default live in the work kind's work block (work.tier.tiers, work.attempts.max), not in the declaration. A workspace declares them once, it keeps the declaration schema untouched, and #3152 can still move tiers into the declaration with builders later. An item overrides the limit with max_attempts.

    The contract link is work.contract { field, kind } and needs a contract kind file. The reference kind leaves it out until #3148 adds a contract kind; studio can declare its own kind over design/contracts now. A contract that isn't approved is a warning only: readiness rules stay with #3162.

    Decision-point answers are joined, not copied: work.answers names the answer kind, and records --json lists each answer whose constrains holds the item id, including the ones a steward keeps on chant/lifecycle (#2786). That replaces x-factory.understand.

    Outcomes are closed: done, not_done, abandoned, gated, waiting, dropped, redraft, ask. abandoned is new, for closing out someone else's expired lease. not_done and abandoned count as attempts, and so do expired or lost claims and legacy free text. chant reports the count and exhaustion in work history; it doesn't refuse a claim on an exhausted item, since the loop's rules are #3162's.

    Kept attempts are refs/chant/kept/[/]/, written by the executor for an Op with changesCheckout that ends not_done. They are local refs; replicating them is #3172. Studio's refs/factory/dispatch/* fountain handoff refs stay studio runtime.

    result keeps only lease; build provenance is the run record's (#3033). A person-triggered retry (studio#232) is not part of this; it fits #3162.

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

    area:workspaceboundariesenhancementlevel:2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions