Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3d7effe
test(FIX-2087): the closure's goal and the task-surface sweep in CI
claude Oct 23, 2026
63da04f
test(FIX-2087): the closure's first verdicts
claude Oct 23, 2026
f6d06f1
test(FIX-2087): the sweep reads tools and endings by symbol; controls…
claude Oct 23, 2026
b6f75bf
test(FIX-2087): a forwarder exempts only its forwarding; every block …
claude Oct 23, 2026
fdb18c5
Merge remote-tracking branch 'origin/main' into fix/FIX-2087
claude Oct 23, 2026
b76f76b
test(FIX-2087): j1 counts only notice requests that ran a turn; j1:he…
claude Oct 23, 2026
e7c24c7
Merge remote-tracking branch 'origin/main' into fix/FIX-2087
claude Oct 23, 2026
7e07954
Merge remote-tracking branch 'origin/main' into fix/FIX-2087
claude Oct 23, 2026
deaccbd
test(FIX-2087): row 3 grades the closure's own findings
claude Oct 23, 2026
1ba899d
test(FIX-2087): classify the closure goal in FIX-1792's census
claude Oct 23, 2026
89217e4
test(FIX-2087): the closure's verdict on main with every closure fix …
claude Oct 23, 2026
024a259
Merge remote-tracking branch 'origin/main' into fix/FIX-2087
claude Oct 23, 2026
5e5ee0e
test(FIX-2087): row 3 grades FIX-2123, FIX-2135 and FIX-2136
claude Oct 23, 2026
455b3fb
test(FIX-2087): a hearing is a notice admitted, not a request started
claude Oct 23, 2026
1defdcc
Merge remote-tracking branch 'origin/main' into fix/FIX-2087
claude Oct 23, 2026
e51ac8b
test(FIX-2087): row 3 runs FIX-2138's regression test
claude Oct 23, 2026
cde0a95
test(FIX-2087): round 3's verdicts
claude Oct 23, 2026
46a6629
Merge origin/main into fix/FIX-2087
claude Oct 23, 2026
4ec08e6
test(goals): grade FIX-2147, FIX-2149 and FIX-2150 in the closure's r…
claude Oct 23, 2026
8a5ed55
refactor(goals): fold the shorter one-task notes from #3790 (083cef8a…
claude Oct 23, 2026
77dd49e
fix(goals): the closure fails closed, and grades a word-for-word foll…
claude Oct 23, 2026
683c151
fix(goals): every control's tags must go red, and the door rule reads…
claude Oct 23, 2026
9a35628
fix(goals): read a control's red from its tagged failures, and bring …
claude Oct 24, 2026
b6516a8
docs(goals): the closure's goal states how a control is read and what…
claude Oct 24, 2026
eb33735
docs(goals): round 4's verdicts in the closure's log (FIX-2087)
claude Oct 24, 2026
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
Prev Previous commit
Next Next commit
refactor(goals): fold the shorter one-task notes from #3790 (083cef8)…
… (FIX-2087)

Cherry-picked from poc/shorter-one-task-notes: comments that restated
goal.md go, j1 counts admittedRequests, TOOLS_ALLOWED is a set of the
same 7 names, and the rules.mjs, engine.mjs and ci.yml headers are
shorter. Two trimmed comments are kept, since they state facts written
nowhere else: buildsTool's (it reads local variables and conditionals)
and the addTask matcher's (the collection's addTask method stays).

Co-Authored-By: Jake Hoffner <jhoffner@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaN4uTiYqiabCbsFLWM52A
  • Loading branch information
claude and jhoffner committed Oct 23, 2026
commit 8a5ed55bb5f962c8afb7e8243034d05d80b53b2f
17 changes: 6 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,15 @@ jobs:
- name: The lint gate can fail
run: node --test scripts/lint-gate.test.mjs

# One task surface (FIX-2087): five task tools (and answerTask and
# parkOnQuestion until FIX-2058), nothing the FIX-2056 migration table
# removes live, and no ending recorded outside the claim gate or the
# drain. Here rather than beside "One word per thing" in Process guards:
# the endings rule reads callers by type, so it needs the TypeScript this
# job installs. The goal's rules.mjs owns the allow lists; its goal.md says why.
# One task surface (FIX-2087). Here rather than beside "One word per thing"
# in Process guards: the endings rule reads callers by type, so it needs the
# TypeScript this job installs. The goal's rules.mjs owns the allow lists;
# its goal.md says why.
- name: One task surface
run: node goals/workforce-coordination/runs-on-one-task/sweep.mjs

# Every plant (tools built under other names and in sibling files, a
# removed name, endings written through renames, helpers, destructuring,
# element access and .call, a second function named like a recorder) must
# be reported, and nothing else, or the sweep above could pass because it
# stopped reading a rule. It runs even when the sweep above is red.
# Every plant must be reported, and nothing else, or the sweep above could
# pass because it stopped reading a rule. It runs even when the sweep is red.
- name: The task-surface sweep reports its plants
Comment thread
jhoffner marked this conversation as resolved.
Resolved
if: ${{ !cancelled() }}
run: node goals/workforce-coordination/runs-on-one-task/sweep.mjs --control
Comment thread
jhoffner marked this conversation as resolved.
Resolved
Expand Down
20 changes: 7 additions & 13 deletions goals/workforce-coordination/runs-on-one-task/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,11 @@ export function sweepTaskSurface({ repo, plants = [], tracked: given, table: tab
const lineText = (sf, node) => sf.text.split("\n")[lineOf(sf, node) - 1] ?? "";

// ---- tools · every task tool the capability declares --------------------------------------
// A tool is a call of one of core's block builders (`handler`, `generator`, `sequencer`,
// `router`, `evaluator`), read by symbol, not by spelling: an import under any
// name, a namespace member, a local alias (the capability's own `defineTool`) and a
// `.withDefaults(...)` result all resolve to it. The calls read are those in the file that
// defines `createTaskToolsCapability` and in every file it imports, transitively, from its own
// directory (not its subdirectories), so a tool built in a sibling file and imported is read
// too. (A tool imported from another directory of the package is not read: the task board's
// own handler blocks live there and aren't tools.) Every allowed name must be read, or the rule stopped reading and the sweep
// can't tell (`cantTell`).
// A tool is a call of one of core's five block builders, read by symbol: any import name, a
// namespace member, a local alias, or `.withDefaults`. Read in the file that defines
// `createTaskToolsCapability` and, transitively, the files it imports from that same directory.
// A tool imported from another directory is not read: the task board's handler blocks live
// there and are not tools. An allowed name that was not read is CAN'T TELL.
const cantTell = [];
const resolveAlias = (sym) => (sym && sym.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(sym) : sym);
const symbolOf = (expr) => resolveAlias(checker.getSymbolAtLocation(ts.isPropertyAccessExpression(expr) ? expr.name : expr));
Expand Down Expand Up @@ -185,7 +181,7 @@ export function sweepTaskSurface({ repo, plants = [], tracked: given, table: tab
const name = config !== undefined && ts.isObjectLiteralExpression(config) ? nameOfTool(config) : `(config not read: ${config?.getText(sf).slice(0, 60) ?? "none"})`;
scanned.tools++;
tools.push(name);
if (!(name in TOOLS_ALLOWED) && !isMarked(lineText(sf, node))) {
if (!TOOLS_ALLOWED.has(name) && !isMarked(lineText(sf, node))) {
findings.push({ rule: "tools", where: `${rel(sf)}:${lineOf(sf, node)}`, what: `the task surface offers "${name}", which is not one of the five, answerTask or parkOnQuestion` });
}
}
Expand All @@ -194,7 +190,7 @@ export function sweepTaskSurface({ repo, plants = [], tracked: given, table: tab
visit(sf);
}
if (capabilityFiles.length === 0) cantTell.push("tools: no file defines createTaskToolsCapability");
const unread = Object.keys(TOOLS_ALLOWED).filter((n) => !tools.includes(n));
const unread = [...TOOLS_ALLOWED].filter((n) => !tools.includes(n));
if (unread.length > 0) cantTell.push(`tools: the allowed tools ${unread.join(", ")} were not read, so the rule stopped reading the capability`);

// ---- removed · typed matchers (declared props, members called, union members, doors) -----
Expand Down Expand Up @@ -335,8 +331,6 @@ export function sweepTaskSurface({ repo, plants = [], tracked: given, table: tab
// The shapes that hand a collection's write on rather than make it: a `.bind`/`.call`/`.apply`
// receiver, an element access by a non-literal key, a property access not called directly.
let forwards = false;
// A collection's complete or fail, read in any shape: called, `.call`/`.bind`, passed on,
// by element access, or destructured.
if (ts.isPropertyAccessExpression(node) && ENDS.includes(node.name.text) && onCollection(node.expression, node.name)) {
ending = `${node.getText(sf)}`;
forwards = !(ts.isCallExpression(node.parent) && node.parent.expression === node);
Comment thread
jhoffner marked this conversation as resolved.
Resolved
Expand Down
49 changes: 16 additions & 33 deletions goals/workforce-coordination/runs-on-one-task/rules.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
/**
* FIX-2087 task-surface rules: what the task surface may offer, what it no longer has, and who
* may record a task's ending. One engine (`engine.mjs`) reads these for the goal and for CI, so
* the two give one answer on one commit (D2).
* FIX-2087 task-surface rules. `engine.mjs` reads these for the goal and for CI, so the two
* give one answer on one commit (D2).
*
* Three rules:
*
* - **tools**: every task tool the task-tools capability declares (a call of core's
* `handler`, read by symbol), by literal name or `named()`, is on {@link TOOLS_ALLOWED}. A name
* not on it fails, deprecated ones included; an allowed name not read can't be told.
* - **removed**: no surface the epic's migration table removes is live in the swept files.
* Each name row of the table is matched by a scoped matcher where its name means that
* surface ({@link REMOVED}); a behaviour row has no name and is proved by its owning child's
* goal ({@link BEHAVIOUR_ROWS}). The engine reads the table as it stands on the commit and
* fails when a row has neither.
* - **endings**: every caller of a task collection's `complete` or `fail`, read by type through
* the TypeScript program, and every `cancel` that passes the caller's own claim, sits in a
* recorder function on {@link RECORDERS}. A write helper on {@link PASS_THROUGHS}, and a
* collection wrapper on {@link FORWARDERS}, is not a recorder: its own callers are read in
* its place. Each key names exactly one function, or the sweep can't tell.
*
* A line that names a removed surface on purpose (a BP-030 legacy read, a refusal) carries
* the `retired-name-refusal` marker, FIX-1875's and FIX-1876's spelling. The allow lists change
* only with a reason a reviewer can read; FIX-2058, retiring `answerTask`, edits
* {@link TOOLS_ALLOWED}.
* {@link TOOLS_ALLOWED}: task tools the capability may declare. {@link REMOVED}: one matcher per
* name row of {@link MIGRATION_TABLE}. {@link BEHAVIOUR_ROWS}: the goal for a row with no name.
* A row with neither fails. {@link RECORDERS} may write an ending; {@link PASS_THROUGHS} and
* {@link FORWARDERS} are not recorders, and their callers are read instead. Each of those keys
* names exactly one function, or the sweep can't tell. A line that names a removed surface on
* purpose carries the `retired-name-refusal` marker. The lists change only with a reason a
* reviewer can read; FIX-2058, retiring `answerTask`, edits {@link TOOLS_ALLOWED}.
*/
import { REFUSAL_MARKER, ROOTS } from "../../vocabulary/one-word-per-thing/rules.mjs";

Expand All @@ -31,16 +17,13 @@ export { REFUSAL_MARKER, ROOTS };
/** The epic's migration table, read as it stands on the swept commit. */
export const MIGRATION_TABLE = "specs/epics/FIX-2056/migration.md";

/** The task tools a turn may be offered, each with why. Anything else the capability declares fails. */
export const TOOLS_ALLOWED = {
createTask: "FIX-2081: the filer's five",
getTask: "FIX-2081: the filer's five",
listTasks: "FIX-2081: the filer's five",
updateTask: "FIX-2081: the filer's five",
reportProgress: "FIX-2081: the worker's progress checkpoint, one of the five",
answerTask: "FIX-2056 D2: kept until FIX-2058 retires it",
parkOnQuestion: "FIX-2056 D2: the worker's question park, kept until FIX-2058",
};
/** The task tools a turn may be offered. Anything else the capability declares fails. */
export const TOOLS_ALLOWED = new Set([
"createTask", "getTask", "listTasks", "updateTask", // FIX-2081: the filer's five
"reportProgress", // FIX-2081: the worker's progress checkpoint, one of the five
"answerTask", // FIX-2056 D2: kept until FIX-2058 retires it
"parkOnQuestion", // FIX-2056 D2: the worker's question park, kept until FIX-2058
]);

/** Code under the swept roots: the files the AST rules (tools, members, endings) read. */
export const CODE = /^(packages|apps)\/.*\.(ts|tsx|mts|cts)$/;
Expand Down
41 changes: 6 additions & 35 deletions goals/workforce-coordination/runs-on-one-task/run.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,6 @@
* Goal check, FIX-2087: Workforce coordination runs on one task primitive. The closure of epic
* FIX-2056, run on one `main` commit with every other child merged. See goal.md.
*
* Parts (`GOAL_PARTS`, default all, in this order):
*
* - `walk`: legs a to c on the closure's Lab (`lab/`, the cast written by `cast.mts`) served by
* Shift Manager's command, on a real model. a is the concept's walk less the call and the
* Inbox, with the journeys j1 (a worker hands out work and waits on it) and j2 (Alice steers
* one routed task and cancels another) on the same Lab; b kills the server after researcher's
* ending is written and before it is sent; c has researcher fail out.
* - `sweep`: the task-surface sweep (`engine.mjs`, the same engine CI runs), and its plants.
* - `children`: every child goal and check with its controls (`children.mts`), the set of
* children read from Linear at run time when `LINEAR_API_KEY` is set.
* - `gaps`: the 31 in-scope gaps rows, each mapped to the checks that read it (`gaps.mts`).
*
* D1: every assertion is tagged structural or judgment (`TAGS`). A structural FAIL on any
* attempt ends that leg's attempts and is a finding; only a judgment FAIL earns another attempt
* (`GOAL_ATTEMPTS`, default 3). Every attempt is printed.
*
* Controls (each runs only the leg it targets): `GOAL_CONTROL=no-sweeper-payment` (FIX-2078's,
* reused from its goal) must FAIL `b:hears-in-due-time`; `GOAL_CONTROL=no-cascade` (FIX-2080's)
* must FAIL `c:dependent-cancelled`.
*
* Run: pnpm tsx goals/workforce-coordination/runs-on-one-task/run.mts
*/
import { spawnSync } from "node:child_process";
Expand Down Expand Up @@ -186,7 +166,6 @@ function gradeA(store: string, w: WalkA, cast: Cast, tell: Tell): string[] {
if (research.length > 0 && !(work !== undefined && work.status === "completed" && (R.completedAt ?? Infinity) > Math.max(work.updatedAt, lastEnd))) {
f.push(`a:ends-running — wanted writer's task to stay running past its first request and its research: work ${show(work)}, research ended ${lastEnd}, task ${R.status} at ${R.completedAt}`);
}
// One notice per research ending starts writer again: exactly one admitted request per ending.
const settled = settledRequests(store, writerSession);
const admitted = admittedRequests(store, writerSession);
if (research.length > 0 && admitted.length !== research.length) {
Expand All @@ -207,7 +186,6 @@ function gradeA(store: string, w: WalkA, cast: Cast, tell: Tell): string[] {
if (R.status !== "completed" || draftLines.length !== 1) f.push(`a:lands-once — writer's task ${R.status}; ${draftLines.length} line(s) of its result in Alice's conversation`);
const draft = outputText(R.output);
if (!draft.includes(cast.word) || !draft.includes(cast.factMark)) f.push(`a:draft-content — the draft lacks ${!draft.includes(cast.word) ? `the word "${cast.word}"` : ""} ${!draft.includes(cast.factMark) ? `researcher's fact (${cast.factMark})` : ""}: ${show(draft, 200)}`);
// The follow-up, from the finished task: a new version, and the original untouched.
const fu = w.followUpRow;
if (w.followUp === undefined) f.push(`a:follow-up — not filed: writer's task never completed`);
else if (fu === undefined || fu.status !== "completed" || (fu as { followUpOf?: string }).followUpOf !== R.id || !fu.partition.startsWith(w.conv) || fu.run?.sessionId !== writerSession || outputText(fu.output) === draft) {
Expand All @@ -216,7 +194,6 @@ function gradeA(store: string, w: WalkA, cast: Cast, tell: Tell): string[] {
if (w.before !== undefined && JSON.stringify(taskOf(w.before)?.output) !== JSON.stringify(taskOf(w.after)?.output)) {
f.push(`a:original-unchanged — the original's output changed: ${show(taskOf(w.before)?.output, 120)} then ${show(taskOf(w.after)?.output, 120)}`);
}
// Every ending reaches its filer once.
for (const r of research) {
const heard = lines(store, writerSession ?? "").filter((m) => textOf(m).includes(`(${r.id})`));
if (heard.length !== 1) f.push(`a:once — researcher's ending of ${r.id} reached writer ${heard.length} time(s)`);
Expand All @@ -233,30 +210,24 @@ function gradeJ1(store: string, j: Awaited<ReturnType<typeof journeyHandsOut>>,
const research = filedBy(store, E.id).filter((r) => r.assignee === CAST.researcher);
if (research.length === 0) f.push(`j1:files — editor filed nothing for desk.researcher`);
const works = requests(store).filter((r) => r.sessionId === editorSession && r.actionName === "work");
// The work request read the research's ending with getTask, in the same request.
const read = items(store, editorSession ?? "", "tool_output").filter(
(i) => i.toolCall?.name === "getTask" && works.some((w) => w.id === i.requestId) && JSON.stringify(i.output ?? "").includes('"status":"completed"'),
);
if (research.length > 0 && (E.status !== "completed" || works.length !== 1 || read.length === 0)) {
f.push(`j1:waits-in-request — wanted editor's one work request to read the research's ending with getTask: task ${E.status}, ${works.length} work request(s), ${read.length} completed getTask read(s)`);
}
// That ending reaches editor once: read in the request, so no notice turn runs for it.
// An ending that lands before the getTask wait still starts one onTaskSettled request: at the
// ending nothing is waiting yet, so a notice is owed and sent. Once the wait has read the
// ending, that request finds the notice no longer owed and runs no turn: its output is
// `{ owed: false }` (FIX-2112). A request that runs no turn is not a second hearing, so only
// the requests that admitted the notice (`owed: true`) count against the read. The model-free
// case in goals/task-board/waits-on-a-task-it-filed counts the same way.
// An ending that lands before the getTask wait still starts an onTaskSettled request: nothing
// is waiting yet, so a notice is owed. After the wait reads it, that request finds the notice
// taken and returns `{ owed: false }` with no turn (FIX-2112). Only `owed: true` counts.
// goals/task-board/waits-on-a-task-it-filed counts the same way.
const notices = settledRequests(store, editorSession);
const heardBy = notices.filter((r) => (r.output as { owed?: unknown } | undefined)?.owed === true);
const heardBy = admittedRequests(store, editorSession);
if (research.length > 0 && read.length > 0 && heardBy.length > 0) {
const ended = research[0]!.completedAt ?? 0;
const asked = Math.min(...read.map((i) => Number(i.ts ?? Infinity)));
f.push(`j1:read-once — researcher's ending reached editor twice: its work request read it with getTask (${asked - ended} ms after the ending) and ${heardBy.length} onTaskSettled turn(s) ran for it too (${notices.length} request(s) in all)`);
}
// And it is heard exactly once, by that read: in one request, with no notice that ran a turn.
// This holds the exclusion above to its claim: discounting the `owed: false` requests must not
// let a run where nothing delivered the ending, or two requests did, pass j1:read-once.
// Discounting `{ owed: false }` must not pass a run that never read the ending, or one that admitted it twice.
const readIn = new Set(read.map((i) => i.requestId)).size;
if (research.length > 0 && (readIn !== 1 || heardBy.length !== 0)) {
f.push(`j1:heard-once — wanted researcher's ending heard exactly once, by editor's getTask read: read in ${readIn} request(s), ${heardBy.length} notice turn(s); ${notices.length} onTaskSettled request(s), outputs ${show(notices.map((r) => r.output), 200)}`);
Expand Down
3 changes: 1 addition & 2 deletions goals/workforce-coordination/runs-on-one-task/sweep.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const floor = control ? sweepTaskSurface({ repo: root, tracked, table, plants: f
const secs = ((Date.now() - started) / 1000).toFixed(1);
if (args.has("--json")) {
const { findings, cantTell, tools, scanned, rows } = result;
console.log(JSON.stringify({ findings, cantTell, tools, scanned, rows, allowed: Object.keys(TOOLS_ALLOWED) }));
console.log(JSON.stringify({ findings, cantTell, tools, scanned, rows, allowed: [...TOOLS_ALLOWED] }));
process.exit(0);
}

Expand All @@ -176,7 +176,6 @@ if (args.has("--rows")) for (const r of result.rows) console.log(` ${r.by.padEn

const byRule = (rule) => result.findings.filter((f) => f.rule === rule);
if (control) {
// Exactly the plants: each reported, and nothing else changed against the plain run.
const key = (f) => `${f.rule} ${f.where} ${f.what}`;
const before = new Set(plain.findings.map(key));
const added = result.findings.filter((f) => !before.has(key(f)));
Expand Down