bareloop 0.54.0 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/bareloop.context.md +73 -12
- package/package.json +3 -3
- package/src/authorflow.js +148 -46
- package/src/authoring.js +21 -4
- package/src/authorjob.js +82 -3
- package/src/authorreadout.js +20 -3
- package/src/authorrun.js +1 -1
- package/src/authorscout.js +9 -6
- package/src/bridges.js +4 -3
- package/src/cardschedule.js +42 -0
- package/src/carrystore.js +1 -1
- package/src/checkpick.js +576 -0
- package/src/checksuggest.js +28 -0
- package/src/checkwords.js +25 -0
- package/src/cli.js +1 -1
- package/src/config.js +24 -1
- package/src/declaredclose.js +1 -1
- package/src/destpoint.js +149 -0
- package/src/draftspend.js +39 -0
- package/src/factwords.js +14 -1
- package/src/job.js +81 -1
- package/src/jobblock.js +9 -0
- package/src/labelscan.js +11 -0
- package/src/launcher.js +10 -6
- package/src/learn.js +6 -4
- package/src/mcpchecks.js +52 -0
- package/src/mcppick.js +36 -0
- package/src/mcpsources.js +77 -0
- package/src/mcpuse.js +97 -0
- package/src/natural.js +23 -0
- package/src/pagemap.js +5 -2
- package/src/panel/authorroutes.js +90 -15
- package/src/panel/authorsession.js +183 -21
- package/src/panel/index.html +686 -26
- package/src/panel/jobgrid.js +117 -0
- package/src/panel/jobplan.js +31 -15
- package/src/panel/scheduler.js +80 -13
- package/src/panel/schedules.js +189 -28
- package/src/panel/schedulestart.js +44 -13
- package/src/panel/server.js +438 -33
- package/src/panel/settingsroutes.js +133 -3
- package/src/panel/status.js +22 -2
- package/src/panel/tickets.js +44 -0
- package/src/pickrecord.js +145 -0
- package/src/plan.js +31 -2
- package/src/planrun.js +71 -15
- package/src/prcheckout.js +259 -0
- package/src/readshim.js +3 -2
- package/src/replay.js +6 -0
- package/src/reuse.js +3 -3
- package/src/revises.js +56 -0
- package/src/rubricstep.js +62 -16
- package/src/run.js +10 -1
- package/src/runexport.js +2 -0
- package/src/runlist.js +3 -2
- package/src/schedulewords.js +46 -4
- package/src/source.js +81 -7
- package/src/stepmcp.js +86 -0
- package/src/ticket.js +113 -0
- package/src/ticketfilter.js +76 -0
- package/src/ticketlabels.js +79 -0
- package/src/ticketmcp.js +111 -0
- package/src/ticketnext.js +35 -0
- package/src/ticketrepo.js +98 -0
- package/src/ticketschedule.js +32 -0
- package/src/ticketshape.js +45 -0
- package/src/tools.js +9 -0
- package/src/trigger.js +14 -2
- package/src/triggerclock.js +7 -3
- package/src/triggerfiles.js +19 -11
- package/src/triggertickets.js +244 -0
- package/src/u-readout.js +2 -2
- package/src/userrun.js +146 -10
- package/src/validate.js +3 -1
- package/src/worktree.js +43 -1
- package/types/authorflow.d.ts +128 -28
- package/types/authorjob.d.ts +16 -3
- package/types/authorreadout.d.ts +9 -2
- package/types/authorscout.d.ts +4 -2
- package/types/bridges.d.ts +4 -3
- package/types/cardschedule.d.ts +24 -0
- package/types/checkpick.d.ts +297 -0
- package/types/checksuggest.d.ts +30 -0
- package/types/checkwords.d.ts +14 -0
- package/types/config.d.ts +7 -0
- package/types/destpoint.d.ts +87 -0
- package/types/draftspend.d.ts +16 -0
- package/types/factwords.d.ts +7 -0
- package/types/job.d.ts +13 -0
- package/types/jobblock.d.ts +9 -0
- package/types/labelscan.d.ts +7 -0
- package/types/launcher.d.ts +7 -2
- package/types/mcpchecks.d.ts +8 -0
- package/types/mcppick.d.ts +33 -0
- package/types/mcpsources.d.ts +51 -0
- package/types/mcpuse.d.ts +15 -0
- package/types/natural.d.ts +2 -0
- package/types/pagemap.d.ts +2 -1
- package/types/panel/authorroutes.d.ts +11 -2
- package/types/panel/authorsession.d.ts +58 -3
- package/types/panel/jobgrid.d.ts +405 -0
- package/types/panel/jobplan.d.ts +10 -4
- package/types/panel/scheduler.d.ts +7 -2
- package/types/panel/schedules.d.ts +124 -4
- package/types/panel/schedulestart.d.ts +21 -3
- package/types/panel/server.d.ts +427 -6
- package/types/panel/settingsroutes.d.ts +4 -2
- package/types/panel/status.d.ts +16 -2
- package/types/panel/tickets.d.ts +61 -0
- package/types/pickrecord.d.ts +88 -0
- package/types/plan.d.ts +1 -0
- package/types/prcheckout.d.ts +151 -0
- package/types/readshim.d.ts +4 -3
- package/types/replay.d.ts +3 -0
- package/types/reuse.d.ts +2 -2
- package/types/revises.d.ts +23 -0
- package/types/rubricstep.d.ts +14 -5
- package/types/run.d.ts +18 -1
- package/types/runlist.d.ts +6 -3
- package/types/schedulewords.d.ts +29 -2
- package/types/source.d.ts +40 -4
- package/types/stepmcp.d.ts +40 -0
- package/types/ticket.d.ts +114 -0
- package/types/ticketfilter.d.ts +34 -0
- package/types/ticketlabels.d.ts +44 -0
- package/types/ticketmcp.d.ts +84 -0
- package/types/ticketnext.d.ts +33 -0
- package/types/ticketrepo.d.ts +118 -0
- package/types/ticketschedule.d.ts +21 -0
- package/types/ticketshape.d.ts +37 -0
- package/types/tools.d.ts +1 -0
- package/types/trigger.d.ts +9 -1
- package/types/triggerclock.d.ts +6 -2
- package/types/triggerfiles.d.ts +13 -5
- package/types/triggertickets.d.ts +110 -0
- package/types/userrun.d.ts +50 -0
- package/types/validate.d.ts +1 -0
- package/types/worktree.d.ts +19 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The key of every job line: its own words, plus how many lines before it have the same words (equal lines match in their order).
|
|
3
|
+
* @param {{n: number, text: string}[]} lines @returns {Map<number, {lineWords: string, occurrence: number}>}
|
|
4
|
+
*/
|
|
5
|
+
export function lineKeys(lines: {
|
|
6
|
+
n: number;
|
|
7
|
+
text: string;
|
|
8
|
+
}[]): Map<number, {
|
|
9
|
+
lineWords: string;
|
|
10
|
+
occurrence: number;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* The entries for answers just given, numbered on THIS card (the answer redraft's card: its line and rule numbers are the ones the asks carried).
|
|
14
|
+
* @param {{n: number, text: string}[]} lines @param {Rule[]} rules
|
|
15
|
+
* @param {{line: number, rule: number, check?: Record<string, any>|null, added?: string|null, own?: boolean}[]} picks @param {{line: number, rule: number}[]} left
|
|
16
|
+
* @returns {Entry[]}
|
|
17
|
+
*/
|
|
18
|
+
export function entriesFromAnswers(lines: {
|
|
19
|
+
n: number;
|
|
20
|
+
text: string;
|
|
21
|
+
}[], rules: Rule[], picks: {
|
|
22
|
+
line: number;
|
|
23
|
+
rule: number;
|
|
24
|
+
check?: Record<string, any> | null;
|
|
25
|
+
added?: string | null;
|
|
26
|
+
own?: boolean;
|
|
27
|
+
}[], left: {
|
|
28
|
+
line: number;
|
|
29
|
+
rule: number;
|
|
30
|
+
}[]): Entry[];
|
|
31
|
+
/**
|
|
32
|
+
* Decide, for the card in hand, which stored picks are kept and which guardrails must be asked.
|
|
33
|
+
* A pick is KEPT when the job line with its words (same order among equal lines) still has its source guardrail with the exact words and, if the pick wrote a `~` line,
|
|
34
|
+
* that line with its exact words too. Otherwise the pick is dropped (never partly kept) and its guardrails are asked: a pair broken on one side is ONE ask, so the
|
|
35
|
+
* partner left on the card is folded (neither asked nor given the old check) - except an EDITED added line (M10 am21): that one is asked (`pairRule` = its source's number) and the source is folded. Pure.
|
|
36
|
+
* @param {Entry[]} entries @param {{n: number, text: string}[]} lines @param {Rule[]} rules every guardrail the call settles
|
|
37
|
+
* @returns {{picks: {line: number, rule: number, check: Record<string, any>|null, added?: string, own?: boolean}[], left: {line: number, rule: number}[],
|
|
38
|
+
* kept: {line: number, rule: number, entry: Entry}[], askRules: (Rule & {pairRule?: number})[]}}
|
|
39
|
+
*/
|
|
40
|
+
export function matchRecord(entries: Entry[], lines: {
|
|
41
|
+
n: number;
|
|
42
|
+
text: string;
|
|
43
|
+
}[], rules: Rule[]): {
|
|
44
|
+
picks: {
|
|
45
|
+
line: number;
|
|
46
|
+
rule: number;
|
|
47
|
+
check: Record<string, any> | null;
|
|
48
|
+
added?: string;
|
|
49
|
+
own?: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
left: {
|
|
52
|
+
line: number;
|
|
53
|
+
rule: number;
|
|
54
|
+
}[];
|
|
55
|
+
kept: {
|
|
56
|
+
line: number;
|
|
57
|
+
rule: number;
|
|
58
|
+
entry: Entry;
|
|
59
|
+
}[];
|
|
60
|
+
askRules: (Rule & {
|
|
61
|
+
pairRule?: number;
|
|
62
|
+
})[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Read a carried record (the session folder's file). A missing or unreadable file is no record (a draft from before R10 has none).
|
|
66
|
+
* @param {string} file @returns {Entry[]|null}
|
|
67
|
+
*/
|
|
68
|
+
export function readRecordFile(file: string): Entry[] | null;
|
|
69
|
+
/** the record's file, inside a drafting session folder only (never a run folder) */
|
|
70
|
+
export const RECORD_FILE: "picks-record.json";
|
|
71
|
+
/** the exact words a kept pick is marked with in the draft log, the Audit and the plan card (M10 am17 (6)) */
|
|
72
|
+
export const KEPT_WORDS: "kept from last draft";
|
|
73
|
+
export function sameWords(a: unknown, b: unknown): boolean;
|
|
74
|
+
export function recordPath(planDir: string): string;
|
|
75
|
+
export type Entry = {
|
|
76
|
+
lineWords: string;
|
|
77
|
+
occurrence: number;
|
|
78
|
+
ruleText: string;
|
|
79
|
+
added: string | null;
|
|
80
|
+
check: Record<string, any> | null;
|
|
81
|
+
own: boolean;
|
|
82
|
+
left: boolean;
|
|
83
|
+
};
|
|
84
|
+
export type Rule = {
|
|
85
|
+
line: number;
|
|
86
|
+
rule: number;
|
|
87
|
+
text: string;
|
|
88
|
+
};
|
package/types/plan.d.ts
CHANGED
|
@@ -161,6 +161,7 @@ export const MAX_SCOPE_MENU: 24;
|
|
|
161
161
|
* guard there): the rule and its pre-flight must read ONE spelling of which
|
|
162
162
|
* verbs count, never two that can drift apart. */
|
|
163
163
|
export const RETRIEVAL_PAIR: readonly string[];
|
|
164
|
+
export function mcpToolsExample(mcp: any): string;
|
|
164
165
|
/** P (design record 2026-07-28): the signed per-step model-tier menu. Closed by
|
|
165
166
|
* construction — the agent picks a tier, never names an arbitrary model string
|
|
166
167
|
* (the tier→model mapping and any effort params are the RUNNER's, per provider).
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PR address a ticket list gives: `https://github.com/<owner>/<repo>/pull/<n>`.
|
|
3
|
+
* @param {unknown} url
|
|
4
|
+
* @returns {{ok: true, owner: string, repo: string, number: number}|{ok: false, error: string}}
|
|
5
|
+
*/
|
|
6
|
+
export function parsePrAddress(url: unknown): {
|
|
7
|
+
ok: true;
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
number: number;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* THE one accessor of the frozen PR record's head commit: GitHub's own `head.sha`. Everything in this file reads the head through here, so the day the reader's record
|
|
17
|
+
* names it differently there is one line to change. A record without a full 40-hex sha has no head (null).
|
|
18
|
+
* @param {any} record @returns {string|null}
|
|
19
|
+
*/
|
|
20
|
+
export function prHeadSha(record: any): string | null;
|
|
21
|
+
/** the PR's base as the record gives it (`base.ref`, `base.sha`), or null when it names none @param {any} record @returns {{ref: string|null, sha: string}|null} */
|
|
22
|
+
export function prBaseOf(record: any): {
|
|
23
|
+
ref: string | null;
|
|
24
|
+
sha: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/**
|
|
27
|
+
* The remotes a git config text declares, with their addresses AS WRITTEN (before any `insteadOf` rewrite): `[remote "name"]` sections, `url = ...` lines.
|
|
28
|
+
* Read from the config file instead of `git remote`, which would need a subcommand this piece is not allowed and prints the rewritten address.
|
|
29
|
+
* @param {string} text @returns {{name: string, url: string}[]}
|
|
30
|
+
*/
|
|
31
|
+
export function remotesOfConfig(text: string): {
|
|
32
|
+
name: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Does a remote address name `github.com/<owner>/<repo>`? https, ssh:// and the scp-like `git@github.com:owner/repo.git` forms; case-blind, `.git` optional.
|
|
37
|
+
* @param {string} url @param {string} owner @param {string} repo
|
|
38
|
+
*/
|
|
39
|
+
export function remoteNames(url: string, owner: string, repo: string): boolean;
|
|
40
|
+
/** the remote to fetch from: `origin` when it names the repo, else the first that does; null = none @param {{name: string, url: string}[]} remotes @returns {{name: string, url: string}|null} */
|
|
41
|
+
export function matchRemote(remotes: {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
}[], owner: any, repo: any): {
|
|
45
|
+
name: string;
|
|
46
|
+
url: string;
|
|
47
|
+
} | null;
|
|
48
|
+
/** an address that carries a login: `https://user:pass@host`, `https://token@host`, or `ssh://user:pass@host` (a bare ssh user such as `git@` is not a secret) @param {string} url */
|
|
49
|
+
export function urlCarriesLogin(url: string): boolean;
|
|
50
|
+
/** the address with any login masked, for the words a person reads @param {string} url */
|
|
51
|
+
export function maskUrl(url: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The environment of every git child of this piece: the panel's env MINUS what `CLOSE_ENV_DENY` names (the one deny list, never re-spelled), KEEPING `HOME` and
|
|
54
|
+
* `SSH_AUTH_SOCK` (the documented exception: stripping it breaks git over ssh), with prompts off - no human is mid-run, so a credential question is a refusal, never a wait.
|
|
55
|
+
* @param {NodeJS.ProcessEnv} base @returns {NodeJS.ProcessEnv}
|
|
56
|
+
*/
|
|
57
|
+
export function prGitEnv(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
58
|
+
/**
|
|
59
|
+
* The argv of one git call. The subcommand is checked against `PR_GIT_SUBCOMMANDS` HERE, before any process exists.
|
|
60
|
+
* @param {string} sub @param {string[]} rest @param {string[]} [cfg] extra `-c key=value` words
|
|
61
|
+
* @returns {string[]}
|
|
62
|
+
*/
|
|
63
|
+
export function prGitArgs(sub: string, rest: string[], cfg?: string[]): string[];
|
|
64
|
+
/**
|
|
65
|
+
* The fetch (spec item 3): the PR's head ref from the base repo into bareloop's private ref, so the object survives gc during the run and no branch, tag or FETCH_HEAD is touched.
|
|
66
|
+
* The `+` lets a Rerun move the ref when the PR was force-pushed since the last run.
|
|
67
|
+
* @param {string} remote @param {number} n @param {{writeFetchHead?: boolean}} [o] `false` (default) = `--no-write-fetch-head`
|
|
68
|
+
* @returns {string[]} the subcommand's own args (after `fetch`)
|
|
69
|
+
*/
|
|
70
|
+
export function fetchRest(remote: string, n: number, { writeFetchHead }?: {
|
|
71
|
+
writeFetchHead?: boolean;
|
|
72
|
+
}): string[];
|
|
73
|
+
/** git's reason, one line, with logins in addresses and secret shapes masked @param {string} stderr @param {string} [fallback] */
|
|
74
|
+
export function firstReason(stderr: string, fallback?: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* @typedef {object} PrCheckout
|
|
77
|
+
* @property {string} sha the PR's head commit, now the worktree's detached HEAD @property {number} number @property {string} ownerRepo `owner/repo`
|
|
78
|
+
* @property {string} remote the remote the fetch used @property {string} ref the private ref @property {{ref: string|null, sha: string}|null} base @property {string|null} mergeBase
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* RUN START for a PR job: fetch the PR's head, verify it is the sha the frozen record names, and move the run's worktree there (detached). Every refusal is plain words
|
|
82
|
+
* that end in "Nothing spent." and leaves no private ref behind. Never pushes; the person's own tree is never touched (the worktree is the run's).
|
|
83
|
+
* @param {object} o
|
|
84
|
+
* @param {string} o.repo the person's repo root (the worktree's `repo` in source.json) @param {string} o.worktree the run's worktree
|
|
85
|
+
* @param {{url: string, record: any, reread?: () => Promise<any>}} o.pr `url` = the PR address; `record` = the frozen PR record; `reread` = optional: read the record again (one try, spec item 5)
|
|
86
|
+
* @param {NodeJS.ProcessEnv} [o.env] @param {number} [o.timeoutMs] @param {typeof spawnClose} [o.run] test seam for the child process
|
|
87
|
+
* @returns {Promise<{ok: true, checkout: PrCheckout}|{ok: false, error: string}>}
|
|
88
|
+
*/
|
|
89
|
+
export function checkoutPrHead({ repo, worktree, pr, env, timeoutMs, run }: {
|
|
90
|
+
repo: string;
|
|
91
|
+
worktree: string;
|
|
92
|
+
pr: {
|
|
93
|
+
url: string;
|
|
94
|
+
record: any;
|
|
95
|
+
reread?: () => Promise<any>;
|
|
96
|
+
};
|
|
97
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
98
|
+
timeoutMs?: number | undefined;
|
|
99
|
+
run?: typeof spawnClose | undefined;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
ok: true;
|
|
102
|
+
checkout: PrCheckout;
|
|
103
|
+
} | {
|
|
104
|
+
ok: false;
|
|
105
|
+
error: string;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* A RESUME's check (spec item 12): the recorded PR head is an ancestor of the worktree's HEAD, so the work branch still holds the PR's code. No fetch.
|
|
109
|
+
* @param {string} worktree @param {string} prHead @param {{run?: typeof spawnClose, env?: NodeJS.ProcessEnv}} [o]
|
|
110
|
+
* @returns {Promise<boolean>}
|
|
111
|
+
*/
|
|
112
|
+
export function prHeadIsAncestor(worktree: string, prHead: string, { run, env }?: {
|
|
113
|
+
run?: typeof spawnClose;
|
|
114
|
+
env?: NodeJS.ProcessEnv;
|
|
115
|
+
}): Promise<boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* Write the checkout into the run's `source.json` (spec item 6): `seed:<sha>`, `prHead`, `prNumber`, `prBase:{ref,sha}`. Only these fields change.
|
|
118
|
+
* @param {string} into the prepared copy's folder (holds source.json) @param {PrCheckout} c
|
|
119
|
+
*/
|
|
120
|
+
export function recordPrOnManifest(into: string, c: PrCheckout): void;
|
|
121
|
+
export { prRefName };
|
|
122
|
+
/** the ONLY git subcommands this piece may run (spec item 10a): anything else throws before a process is made. Nothing that writes to a remote, to the person's config or to their index is on the list. */
|
|
123
|
+
export const PR_GIT_SUBCOMMANDS: readonly string[];
|
|
124
|
+
/** the hard deadline of the fetch, in ms (spec item 3: 120 s; tighten-only, like the other clamps) */
|
|
125
|
+
export const PR_FETCH_DEADLINE_MS: 120000;
|
|
126
|
+
export type PrCheckout = {
|
|
127
|
+
/**
|
|
128
|
+
* the PR's head commit, now the worktree's detached HEAD
|
|
129
|
+
*/
|
|
130
|
+
sha: string;
|
|
131
|
+
number: number;
|
|
132
|
+
/**
|
|
133
|
+
* `owner/repo`
|
|
134
|
+
*/
|
|
135
|
+
ownerRepo: string;
|
|
136
|
+
/**
|
|
137
|
+
* the remote the fetch used
|
|
138
|
+
*/
|
|
139
|
+
remote: string;
|
|
140
|
+
/**
|
|
141
|
+
* the private ref
|
|
142
|
+
*/
|
|
143
|
+
ref: string;
|
|
144
|
+
base: {
|
|
145
|
+
ref: string | null;
|
|
146
|
+
sha: string;
|
|
147
|
+
} | null;
|
|
148
|
+
mergeBase: string | null;
|
|
149
|
+
};
|
|
150
|
+
import { spawnClose } from './ralph.js';
|
|
151
|
+
import { prRefName } from './worktree.js';
|
package/types/readshim.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export function buildReadMap({ rel, lines, chunks }: {
|
|
|
46
46
|
symbols: number;
|
|
47
47
|
} | null;
|
|
48
48
|
/**
|
|
49
|
-
* @typedef {{root: string, hasGet: boolean, getNode: (rel: string) => any, refresh?: (() => Promise<unknown>)|null, emit: (type: string, data: object) => void}} ReadMapOpts
|
|
49
|
+
* @typedef {{root: string, hasGet: boolean, getNode: (rel: string) => any, indexed?: (() => boolean)|null, refresh?: (() => Promise<unknown>)|null, emit: (type: string, data: object) => void}} ReadMapOpts
|
|
50
50
|
* `root`: the job root (paths are made relative to it); `hasGet`: this worker holds `ctx_get` (a map hands out handles only that tool opens);
|
|
51
|
-
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
51
|
+
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `indexed`: whether the job has an index at all (`lc.indexed`; false skips with `no-index`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
52
52
|
* `emit`: the spine channel, for the report-only `read-map` / `read-map-skip` records (counts and a reason, never text).
|
|
53
53
|
*/
|
|
54
54
|
/**
|
|
@@ -135,13 +135,14 @@ export const READ_MAP_MIN_LINES: 200;
|
|
|
135
135
|
export const READ_MAP_CAP: 4000;
|
|
136
136
|
/**
|
|
137
137
|
* `root`: the job root (paths are made relative to it); `hasGet`: this worker holds `ctx_get` (a map hands out handles only that tool opens);
|
|
138
|
-
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
138
|
+
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `indexed`: whether the job has an index at all (`lc.indexed`; false skips with `no-index`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
139
139
|
* `emit`: the spine channel, for the report-only `read-map` / `read-map-skip` records (counts and a reason, never text).
|
|
140
140
|
*/
|
|
141
141
|
export type ReadMapOpts = {
|
|
142
142
|
root: string;
|
|
143
143
|
hasGet: boolean;
|
|
144
144
|
getNode: (rel: string) => any;
|
|
145
|
+
indexed?: (() => boolean) | null;
|
|
145
146
|
refresh?: (() => Promise<unknown>) | null;
|
|
146
147
|
emit: (type: string, data: object) => void;
|
|
147
148
|
};
|
package/types/replay.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ export function replayRun(spineEvents: any[], auditEvents?: any[], { runId, audi
|
|
|
149
149
|
spentUsd: number | null;
|
|
150
150
|
unpricedRounds: number;
|
|
151
151
|
tripped: {
|
|
152
|
+
ladder?: boolean | undefined;
|
|
152
153
|
category: any;
|
|
153
154
|
detail: string | null;
|
|
154
155
|
} | null;
|
|
@@ -211,6 +212,7 @@ export function replayRun(spineEvents: any[], auditEvents?: any[], { runId, audi
|
|
|
211
212
|
spentUsd: number | null;
|
|
212
213
|
unpricedRounds: number;
|
|
213
214
|
tripped: {
|
|
215
|
+
ladder?: boolean | undefined;
|
|
214
216
|
category: any;
|
|
215
217
|
detail: string | null;
|
|
216
218
|
} | null;
|
|
@@ -237,6 +239,7 @@ export function replayRun(spineEvents: any[], auditEvents?: any[], { runId, audi
|
|
|
237
239
|
spentUsd: number | null;
|
|
238
240
|
unpricedRounds: number;
|
|
239
241
|
tripped: {
|
|
242
|
+
ladder?: boolean | undefined;
|
|
240
243
|
category: any;
|
|
241
244
|
detail: string | null;
|
|
242
245
|
} | null;
|
package/types/reuse.d.ts
CHANGED
|
@@ -484,7 +484,7 @@ export function writeGreenRow({ registryDir, bridge, meta, record }: {
|
|
|
484
484
|
* row, and if so, write it.
|
|
485
485
|
*
|
|
486
486
|
* `scripts/run-u.mjs` has always kept standalone bridge FILES and never a registry,
|
|
487
|
-
* so its review door could describe a held
|
|
487
|
+
* so its review door could describe a held reuse credit it had no row to release:
|
|
488
488
|
* `--decide accept` reached `recordDoor`, found no green row for the runid and died
|
|
489
489
|
* `no-row-for-run`. This is the row, and STORAGE IS ALL IT IS — selection, promotion
|
|
490
490
|
* and reuse execution stay parked (layer-3-reuse). Nothing here reads a row back.
|
|
@@ -525,7 +525,7 @@ export function writeRunGreenRow({ registryDir, job, name, outcome, plan, record
|
|
|
525
525
|
/**
|
|
526
526
|
* Apply a signer's door decision to the workflow a run wrote its row against:
|
|
527
527
|
* record the disposition, and — on `accept` over a HELD judged green — release the
|
|
528
|
-
*
|
|
528
|
+
* reuse credit that green has been carrying unspent (PRD v1.71 §3).
|
|
529
529
|
*
|
|
530
530
|
* This is the ONE seam between a person's answer and the box. It is deliberately
|
|
531
531
|
* separate from `runReuse`: the door opens AFTER the run has ended (a green run is
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The one spelling of the drafting sessions folder (the session and the routes both read it).
|
|
2
|
+
* @param {string|undefined} root */
|
|
3
|
+
export function sessionsRootOf(root: string | undefined): string;
|
|
4
|
+
/** @param {string} root @param {string} id revises used by that draft; no file, or an unreadable one, is 0 (a draft from before the count existed)
|
|
5
|
+
* @returns {number} */
|
|
6
|
+
export function revisesUsedOf(root: string, id: string): number;
|
|
7
|
+
/** The revises a draft will have used, given what it follows: a Revise adds one to the draft it follows; Start over, or following nothing, starts at 0.
|
|
8
|
+
* @param {string} root @param {unknown} carryFrom @param {unknown} carryKind
|
|
9
|
+
* @returns {number} */
|
|
10
|
+
export function nextRevisesUsed(root: string, carryFrom: unknown, carryKind: unknown): number;
|
|
11
|
+
/** Plain words when that revise would be a third; null when it is allowed. $0: called before anything is ended or started.
|
|
12
|
+
* @param {string} root @param {unknown} carryFrom @param {unknown} carryKind
|
|
13
|
+
* @returns {string|null} */
|
|
14
|
+
export function reviseRefusal(root: string, carryFrom: unknown, carryKind: unknown): string | null;
|
|
15
|
+
/** The words the draft record and the Audit use for a draft that follows another (fwdloop am14 item 6): `revise 1`, `revise 2`, `start over`; a first draft has none.
|
|
16
|
+
* @param {unknown} carryFrom @param {unknown} carryKind @param {number} used this draft's revises used
|
|
17
|
+
* @returns {string|null} */
|
|
18
|
+
export function draftLabelOf(carryFrom: unknown, carryKind: unknown, used: number): string | null;
|
|
19
|
+
/** @param {string} dir the session's folder @param {number} used */
|
|
20
|
+
export function writeRevisesUsed(dir: string, used: number): void;
|
|
21
|
+
export const MAX_REVISES: 2;
|
|
22
|
+
/** the count's file, inside a drafting session folder only */
|
|
23
|
+
export const REVISES_FILE: "revises.json";
|
package/types/rubricstep.d.ts
CHANGED
|
@@ -170,11 +170,16 @@ export function inputLabelsOf(inputs: unknown): string[] | null;
|
|
|
170
170
|
* naming both parts and both numbers;
|
|
171
171
|
* - a `cited` part names a label the person's inputs do not have.
|
|
172
172
|
* @param {any[]} stages the declaration's stages
|
|
173
|
-
* @param {{inputLabels?: string[]|null, red: (code: string, path: string, detail: string, extra?: object) => void}} o
|
|
174
|
-
* `inputLabels` absent = the label rule is not run (a caller with no inputs in hand)
|
|
173
|
+
* @param {{inputLabels?: string[]|null, picks?: {line: number, part: any}[]|null, red: (code: string, path: string, detail: string, extra?: object) => void}} o
|
|
174
|
+
* `inputLabels` absent = the label rule is not run (a caller with no inputs in hand);
|
|
175
|
+
* `picks` = the record of the person's picks (`declaration.picks`, `{line, part}` each): the only countable parts a fact line may carry
|
|
175
176
|
*/
|
|
176
|
-
export function checkRubricParts(stages: any[], { inputLabels, red }: {
|
|
177
|
+
export function checkRubricParts(stages: any[], { inputLabels, red, picks }: {
|
|
177
178
|
inputLabels?: string[] | null;
|
|
179
|
+
picks?: {
|
|
180
|
+
line: number;
|
|
181
|
+
part: any;
|
|
182
|
+
}[] | null;
|
|
178
183
|
red: (code: string, path: string, detail: string, extra?: object) => void;
|
|
179
184
|
}): void;
|
|
180
185
|
/** the ~ rules of one job line, one string each (`rules` when the line has the array, else the joined `rule` split on "; ") @param {any} l @returns {string[]} */
|
|
@@ -249,13 +254,16 @@ export function partSentence(part: any): string;
|
|
|
249
254
|
/**
|
|
250
255
|
* The checks a signed close actually runs, per job line, in plain code-written sentences: one per countable part of every
|
|
251
256
|
* rubric-step stage. This is the ONE reader both the plan card and the sign-time invariant use.
|
|
257
|
+
* Each row says who added the check (`by`): `you` = one of the person's picks, as the signed close's own record (`closeDecl.picks`) names it; `agent` = the drafter's;
|
|
258
|
+
* `null` = code's own tie (the numbers of a text step come from the fact quotes), which is neither.
|
|
252
259
|
* @param {any} closeDecl
|
|
253
|
-
* @returns {{line: number, text: string, covers: number[]}[]}
|
|
260
|
+
* @returns {{line: number, text: string, covers: number[], by: 'agent'|'you'|null}[]}
|
|
254
261
|
*/
|
|
255
262
|
export function checksOfClose(closeDecl: any): {
|
|
256
263
|
line: number;
|
|
257
264
|
text: string;
|
|
258
265
|
covers: number[];
|
|
266
|
+
by: "agent" | "you" | null;
|
|
259
267
|
}[];
|
|
260
268
|
/**
|
|
261
269
|
* The names of the facts a signed close checks (every fact part of every rubric-step stage). Pure.
|
|
@@ -269,7 +277,7 @@ export function signedFactNames(closeDecl: any): string[];
|
|
|
269
277
|
* silently dropped (run mv5bk400: "lists 3 releases" was confirmed, then left out of the signed close without a word).
|
|
270
278
|
* @param {{confirmed: {text: string, fromLine: number[]|null}[], notChecked: string[], closeDecl: any, jobLines?: any[]|null}} o
|
|
271
279
|
* `jobLines` — the person's numbered lines, so a ~ rule the drafter listed as Not checked reads in the person's own words
|
|
272
|
-
* @returns {{checkItems: {text: string, fromLine: number[]}[], notChecked: string[], moved: {text: string, fromLine: number[]|null}[]}}
|
|
280
|
+
* @returns {{checkItems: {text: string, fromLine: number[], by: 'agent'|'you'|null}[], notChecked: string[], moved: {text: string, fromLine: number[]|null}[]}}
|
|
273
281
|
*/
|
|
274
282
|
export function reconcileRubricPlan({ confirmed, notChecked, closeDecl, jobLines }: {
|
|
275
283
|
confirmed: {
|
|
@@ -283,6 +291,7 @@ export function reconcileRubricPlan({ confirmed, notChecked, closeDecl, jobLines
|
|
|
283
291
|
checkItems: {
|
|
284
292
|
text: string;
|
|
285
293
|
fromLine: number[];
|
|
294
|
+
by: "agent" | "you" | null;
|
|
286
295
|
}[];
|
|
287
296
|
notChecked: string[];
|
|
288
297
|
moved: {
|
package/types/run.d.ts
CHANGED
|
@@ -145,6 +145,11 @@
|
|
|
145
145
|
* collision walk would mint a `-2` beside the work the resume exists to continue. The
|
|
146
146
|
* fold's precedent exactly: the chain's state is DECLARED, never re-derived. Forwarded
|
|
147
147
|
* verbatim to the plan flow; absent is the cold path.
|
|
148
|
+
* @param {string|null} [opts.ticketUnsure] R9 (9.4): the ticket filter's `unsure` reason when it let the ticket run unsure; rides onto `job-start` as `ticketFilter.unsure`
|
|
149
|
+
* @param {import('./ticketrepo.js').RepoTicketRecord|null} [opts.ticketRecord] MCP + tickets piece 1a: a CODE-REPO job's frozen ticket (metadata only: number, title,
|
|
150
|
+
* state, source, sha256, bytes, masked count, the frozen file's relative path, the MCP record - never the text). Report-only: it rides onto `job-start` as `ticket`,
|
|
151
|
+
* so the run's books name the exact bytes the worker could read. Absent = the job reads no ticket (or froze it in its prepared copy's `source.json`).
|
|
152
|
+
* @param {{number: number, ownerRepo: string, head: string, base: {ref: string|null, sha: string}|null, mergeBase: string|null}|null} [opts.prRecord] MCP + tickets piece 12: the PR a worktree job was checked out at (the head sha the seed is, the base and the merge-base for the readout). Report-only: rides onto `job-start` as `pr`.
|
|
148
153
|
* @param {boolean|'cap'|'diff'} [opts.readShim=false] THE READ SHIM (src/readshim.js) —
|
|
149
154
|
* WHICH ARM to run, threaded to the plan flow. The Phase 2 pre-registration's four:
|
|
150
155
|
* `false` A0 — off (the default)
|
|
@@ -214,7 +219,7 @@
|
|
|
214
219
|
* deliberately NOT in the resumable/checkpoint set (`src/reuse.js`) — an
|
|
215
220
|
* unknown in-flight state is not a known-safe resume point.
|
|
216
221
|
*/
|
|
217
|
-
export function runJob(rawSpec: object | string, { approvals, workdir, provider, nativeProvider, providerFor, judgeProvider, judgeModel, rates, judgeRates, emit, capRuns, strikeLimit, shellCapUsd, closeTimeoutMs, closeDir, layerRoot, readShim, scout, bridge, draftSpentUsd, draftSpendComplete, priorSpentUsd, priorSpendComplete, priorWallMs, resumeSeed, resumeGrades, resumeReplans, resumeBranch, humanRuling, heldRuling, reviewDoor, doorRerun, resumable, stopFile, learnHints }: {
|
|
222
|
+
export function runJob(rawSpec: object | string, { approvals, workdir, provider, nativeProvider, providerFor, judgeProvider, judgeModel, rates, judgeRates, emit, capRuns, strikeLimit, shellCapUsd, closeTimeoutMs, closeDir, layerRoot, readShim, scout, bridge, draftSpentUsd, draftSpendComplete, priorSpentUsd, priorSpendComplete, priorWallMs, resumeSeed, resumeGrades, resumeReplans, resumeBranch, humanRuling, heldRuling, reviewDoor, doorRerun, resumable, stopFile, learnHints, ticketRecord, ticketUnsure, prRecord }: {
|
|
218
223
|
approvals: unknown;
|
|
219
224
|
workdir: string;
|
|
220
225
|
provider: any;
|
|
@@ -257,6 +262,18 @@ export function runJob(rawSpec: object | string, { approvals, workdir, provider,
|
|
|
257
262
|
grantUsed?: boolean;
|
|
258
263
|
} | null | undefined;
|
|
259
264
|
resumeBranch?: string | null | undefined;
|
|
265
|
+
ticketUnsure?: string | null | undefined;
|
|
266
|
+
ticketRecord?: import("./ticketrepo.js").RepoTicketRecord | null | undefined;
|
|
267
|
+
prRecord?: {
|
|
268
|
+
number: number;
|
|
269
|
+
ownerRepo: string;
|
|
270
|
+
head: string;
|
|
271
|
+
base: {
|
|
272
|
+
ref: string | null;
|
|
273
|
+
sha: string;
|
|
274
|
+
} | null;
|
|
275
|
+
mergeBase: string | null;
|
|
276
|
+
} | null | undefined;
|
|
260
277
|
readShim?: boolean | "diff" | "cap" | undefined;
|
|
261
278
|
scout?: boolean | undefined;
|
|
262
279
|
layerRoot?: boolean | undefined;
|
package/types/runlist.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export function runlistHome(override?: string): string;
|
|
|
13
13
|
*/
|
|
14
14
|
export function runlistPath(home?: string): string;
|
|
15
15
|
/**
|
|
16
|
-
* @typedef {{ at: string, runid: string, job: string, spine: string, patient: string|null, via: 'run-u'|'bundle'|'backfill', pid?: number, capUsd?: number, leg?: number }} RunRow
|
|
16
|
+
* @typedef {{ at: string, runid: string, job: string, spine: string, patient: string|null, via: 'run-u'|'bundle'|'backfill', pid?: number, capUsd?: number, leg?: number, ticket?: number }} RunRow
|
|
17
|
+
* `ticket` (a Tickets run, ITEM33-BUILD R6): the ticket number this run reads; older rows have none.
|
|
17
18
|
* `pid`/`capUsd` (optional; older and backfilled rows carry neither): the runner's process id and the
|
|
18
19
|
* leg's $ cap — what the monthly limit holds while that pid is a live bareloop runner (src/monthly.js).
|
|
19
20
|
* `leg` (P5-R; only on a row {@link readRunList} FOLDED from `leg-start` entries, i.e. a RESUMED run):
|
|
@@ -49,7 +50,7 @@ export function appendRun(row: RunRow, opts?: {
|
|
|
49
50
|
};
|
|
50
51
|
/**
|
|
51
52
|
* @typedef {{ runid: string, type: 'settled'|'released', by: string, at: string, reason?: string, words?: string, spentUsd?: number, spendComplete?: boolean, leg?: number }} RunEvent
|
|
52
|
-
* `words` (2026-10-19): on a `settled` with `reason: 'refused before start'
|
|
53
|
+
* `words` (2026-10-19): on a `settled` with `reason: 'refused before start'` (or, R5, `reason: 'skipped'`: a ticket the job's filter did not let through), the plain words the panel shows for that run (it has no spine).
|
|
53
54
|
* `leg` (P5-R): which leg of the run the write-back is about; absent = leg 1 (every entry written before P5-R).
|
|
54
55
|
* A resumed run is ONE row, so `settled`/`released` are per leg: a later leg's `released` gives back THAT leg's
|
|
55
56
|
* claim and never removes the run.
|
|
@@ -251,6 +252,7 @@ export function runNumbers(rows: any[]): Map<string, number>;
|
|
|
251
252
|
export const DIED_MTIME_MS: number;
|
|
252
253
|
export const MAX_BACKFILL_DEPTH: 6;
|
|
253
254
|
/**
|
|
255
|
+
* `ticket` (a Tickets run, ITEM33-BUILD R6): the ticket number this run reads; older rows have none.
|
|
254
256
|
* `pid`/`capUsd` (optional; older and backfilled rows carry neither): the runner's process id and the
|
|
255
257
|
* leg's $ cap — what the monthly limit holds while that pid is a live bareloop runner (src/monthly.js).
|
|
256
258
|
* `leg` (P5-R; only on a row {@link readRunList} FOLDED from `leg-start` entries, i.e. a RESUMED run):
|
|
@@ -267,9 +269,10 @@ export type RunRow = {
|
|
|
267
269
|
pid?: number;
|
|
268
270
|
capUsd?: number;
|
|
269
271
|
leg?: number;
|
|
272
|
+
ticket?: number;
|
|
270
273
|
};
|
|
271
274
|
/**
|
|
272
|
-
* `words` (2026-10-19): on a `settled` with `reason: 'refused before start'
|
|
275
|
+
* `words` (2026-10-19): on a `settled` with `reason: 'refused before start'` (or, R5, `reason: 'skipped'`: a ticket the job's filter did not let through), the plain words the panel shows for that run (it has no spine).
|
|
273
276
|
* `leg` (P5-R): which leg of the run the write-back is about; absent = leg 1 (every entry written before P5-R).
|
|
274
277
|
* A resumed run is ONE row, so `settled`/`released` are per leg: a later leg's `released` gives back THAT leg's
|
|
275
278
|
* claim and never removes the run.
|
package/types/schedulewords.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R7 (piece 9): the New job card's Schedule row is served with its words from {@link SCHEDULE_WORDS}`.card`, never typed into the page: each token in `index.html` is replaced by
|
|
3
|
+
* the server when the page is sent (the way the port is), so a reword is ONE edit here. @returns {Record<string, string>} token -> escaped words
|
|
4
|
+
*/
|
|
5
|
+
export function scheduleCardFill(): Record<string, string>;
|
|
1
6
|
/**
|
|
2
7
|
* What starts the job, in words. `null` (by hand) has no sentence.
|
|
3
8
|
* @param {Trigger|null|undefined} t @param {string} [home]
|
|
@@ -20,7 +25,7 @@ export function nextInWords(ms: number, now: number): string;
|
|
|
20
25
|
* 3. a clock kind with a next slot; 4. a file kind that is armed; 5. not armed yet.
|
|
21
26
|
* A last outcome of `refused` goes in front of 3-5, so a trigger that cannot start is never silent.
|
|
22
27
|
* `red` is the typed flag for "the person must act": the page paints it and never guesses from the text.
|
|
23
|
-
* @param {{trigger: Trigger, armed: boolean, nextSlotMs: number|null, lastOutcome: any, waitingRunNo: number|null, now: number, retryInMs?: number|null, gaveUp?: any}} f
|
|
28
|
+
* @param {{trigger: Trigger, armed: boolean, nextSlotMs: number|null, lastOutcome: any, waitingRunNo: number|null, now: number, retryInMs?: number|null, gaveUp?: any, lookProblem?: {at: number, why: string}|null}} f
|
|
24
29
|
* `lastOutcome` = the newest outcome row of the CURRENT signing (`kind`, `at` in ms, `why`, `leftUsd`, `needUsd`, `atLeast`)
|
|
25
30
|
* @returns {{text: string, red: boolean}}
|
|
26
31
|
*/
|
|
@@ -33,6 +38,10 @@ export function scheduledNextFor(f: {
|
|
|
33
38
|
now: number;
|
|
34
39
|
retryInMs?: number | null;
|
|
35
40
|
gaveUp?: any;
|
|
41
|
+
lookProblem?: {
|
|
42
|
+
at: number;
|
|
43
|
+
why: string;
|
|
44
|
+
} | null;
|
|
36
45
|
}): {
|
|
37
46
|
text: string;
|
|
38
47
|
red: boolean;
|
|
@@ -71,7 +80,7 @@ export function skippedWords(row: any, short?: boolean): string;
|
|
|
71
80
|
/**
|
|
72
81
|
* Job tab, "Schedule": the job's schedule NOW and what it is bound to. The first part IS the Run tab's line ({@link scheduledWords}),
|
|
73
82
|
* first letter lowered, so the two can never disagree.
|
|
74
|
-
* @param {{trigger: Trigger|null, originNo: number|null, model: string|null, destination: string|null, home?: string}} f
|
|
83
|
+
* @param {{trigger: Trigger|null, originNo: number|null, model: string|null, destination: string|null, home?: string, waiting?: boolean}} f `waiting` (R7): signed with the job and still off
|
|
75
84
|
*/
|
|
76
85
|
export function jobScheduleWords(f: {
|
|
77
86
|
trigger: Trigger | null;
|
|
@@ -79,6 +88,7 @@ export function jobScheduleWords(f: {
|
|
|
79
88
|
model: string | null;
|
|
80
89
|
destination: string | null;
|
|
81
90
|
home?: string;
|
|
91
|
+
waiting?: boolean;
|
|
82
92
|
}): string;
|
|
83
93
|
/** RULED 2026-10-15: the SCHEDULE row's `next` while an install-needed refusal is waiting to be tried again. @param {number} ms */
|
|
84
94
|
export function retryNextWords(ms: number): string;
|
|
@@ -123,15 +133,32 @@ export const SCHEDULE_WORDS: Readonly<{
|
|
|
123
133
|
weekly: "Every <day> at HH:MM";
|
|
124
134
|
'file-updated': "When <file> is updated";
|
|
125
135
|
'new-file': "When a new file arrives in <folder>";
|
|
136
|
+
'new-ticket': "When a new ticket arrives in <input>";
|
|
126
137
|
}>;
|
|
127
138
|
gaveUpPill: "Check";
|
|
128
139
|
problemNext: "next: fix it in Cancel / modify schedule";
|
|
129
140
|
monthNext: "next: raise the limit in Settings, or it starts on the 1st";
|
|
130
141
|
acceptWaiting: "waiting for your Accept (the next run does not wait)";
|
|
142
|
+
waiting: "Schedule waiting for a green run";
|
|
131
143
|
scheduleGroup: "schedule";
|
|
132
144
|
notGreen: "This job has not had a good run yet. Run it by hand and get it right first; then you can set when it runs. A rubric job also needs your Accept once. Nothing was changed.";
|
|
145
|
+
card: Readonly<{
|
|
146
|
+
label: "Schedule";
|
|
147
|
+
options: Readonly<{
|
|
148
|
+
hand: "By hand";
|
|
149
|
+
'new-ticket': "When a new ticket arrives";
|
|
150
|
+
daily: "Every day at HH:MM";
|
|
151
|
+
}>;
|
|
152
|
+
hint: "off until the first green run, then turns on";
|
|
153
|
+
rubricHint: "off until the first green run is accepted, then turns on";
|
|
154
|
+
ticketHint: "the first run reads the newest ticket at the time it starts; older tickets never run";
|
|
155
|
+
}>;
|
|
133
156
|
stale: "What you were shown is not what is on the card now. Nothing was signed. Look again, then sign.";
|
|
134
157
|
}>;
|
|
158
|
+
export function lookProblemWords(p: {
|
|
159
|
+
at: number;
|
|
160
|
+
why: string;
|
|
161
|
+
}): string;
|
|
135
162
|
export function dateTimeWords(ms: number): string;
|
|
136
163
|
export function lowerFirst(s: string): string;
|
|
137
164
|
export type Trigger = import("./trigger.js").Trigger;
|
package/types/source.d.ts
CHANGED
|
@@ -40,6 +40,18 @@ export function nearestGitAncestor(startDir: string): {
|
|
|
40
40
|
* @returns {boolean}
|
|
41
41
|
*/
|
|
42
42
|
export function looksLikeRepoSource(source: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The files of a repo's COMMITTED tree (`git ls-tree -r HEAD`: what a job's worktree holds), or null when git cannot read it.
|
|
45
|
+
* @param {string} root the repo's (or worktree's) top folder @returns {string[]|null}
|
|
46
|
+
*/
|
|
47
|
+
export function repoTrackedFiles(root: string): string[] | null;
|
|
48
|
+
/**
|
|
49
|
+
* R7b (F287): the first piece of a repo Destination (comma or line separated) that the repo's COMMITTED tree does not have, or null when every piece exists.
|
|
50
|
+
* A piece is a folder (`src`, `src/`), a file, or a glob whose folder part exists (`src/**\/*.js`); `.` is the repo root. A tree that cannot be read is null:
|
|
51
|
+
* the copy step refuses that repo with its own words, this check never invents a refusal from a failure.
|
|
52
|
+
* @param {string} root the repo's top folder @param {string} destination @returns {string|null}
|
|
53
|
+
*/
|
|
54
|
+
export function destinationMissingInRepo(root: string, destination: string): string | null;
|
|
43
55
|
/**
|
|
44
56
|
* Build the frozen source tree — `<into>/tree/input/…` (the copy), `<into>/tree/output/`
|
|
45
57
|
* (empty, where the run writes), `<into>/source.json` (the manifest, OUTSIDE
|
|
@@ -315,14 +327,24 @@ export function nonRepoSourceMessage(kind: string): string;
|
|
|
315
327
|
* file. A known secret shape in its content is NOT a refusal (masked where recorded, as the P6 worktree door does).
|
|
316
328
|
* A folder value is checked for existence and tracking only (its files are the repo's own, which the worktree door
|
|
317
329
|
* already masks). Reads the tree; writes nothing.
|
|
330
|
+
* MCP + tickets piece 1a: with `opts.mcp` (the job's signed `{server, tools}`), a line 2+ whose value is a GitHub issues address is a TICKET line, not a repo path: it is proven at $0
|
|
331
|
+
* as "the MCP can read it" (`proveTicketLine`: server named in the person's config, not remote, `issue_read` signed). Only one such line; it is read and frozen at run start.
|
|
332
|
+
* Without `opts.mcp` the same line is the old refusal ("only files inside the repo for now").
|
|
318
333
|
* @param {{n: number, label: string, value: string}[]} inputs the parsed Inputs (`parseInputs`)
|
|
334
|
+
* @param {{mcp?: {server: string, tools: string[]}, configPath?: string}} [opts]
|
|
319
335
|
* @returns {Promise<{ok: true, repo: string, root: string|null}|{ok: false, error: string}>} `repo` = line 1's absolute path; `root` = the git root it sits in (null when line 1 alone was given and it is not in a git repo)
|
|
320
336
|
*/
|
|
321
337
|
export function proveInputFiles(inputs: {
|
|
322
338
|
n: number;
|
|
323
339
|
label: string;
|
|
324
340
|
value: string;
|
|
325
|
-
}[]
|
|
341
|
+
}[], opts?: {
|
|
342
|
+
mcp?: {
|
|
343
|
+
server: string;
|
|
344
|
+
tools: string[];
|
|
345
|
+
};
|
|
346
|
+
configPath?: string;
|
|
347
|
+
}): Promise<{
|
|
326
348
|
ok: true;
|
|
327
349
|
repo: string;
|
|
328
350
|
root: string | null;
|
|
@@ -410,10 +432,16 @@ export function looksLikeRubricInput(value: string): boolean;
|
|
|
410
432
|
* copy. It is written into the prepared tree, committed as the new seed (so the page is never read as a worker write), and
|
|
411
433
|
* `source.json` is rewritten (new sha256 per input, new seed, `draftSha256` keeps what the look saw). Nothing but the text of a
|
|
412
434
|
* recorded web address is ever refetched; a job with only file inputs returns at once and changes nothing.
|
|
413
|
-
*
|
|
414
|
-
*
|
|
435
|
+
*
|
|
436
|
+
* MCP + tickets (piece 1): with `ticket` (a job that reads tickets: `{number, mcp}`, the number per run from `--ticket`), the ONE input row whose address is a
|
|
437
|
+
* GitHub issues list is read through the person's MCP server instead of the page reader: the ticket's reply, MASKED with the one secret inventory before the sha
|
|
438
|
+
* (a secret in a ticket is masked, never refused; page rows keep their refusal), is the run's frozen input. The row keeps its signed `url` (the list address) and
|
|
439
|
+
* gains `mcp:{server,exposed,missing,calls}`, `ticket:{number,title,state,source}` and `masked:<count>`. Any refusal (server or tool missing, a device login,
|
|
440
|
+
* an empty reply, no list row or two) is the same plain `did not start` words at $0.
|
|
441
|
+
* @param {{into: string, fetchUrl?: (url: string) => Promise<{ok: true, text: string, url: string}|{ok: false, error: string}>, ticket?: {number: number, mcp: {server: string, tools: string[]}}}} o `into` - the prepared copy (source.json + tree/)
|
|
442
|
+
* @returns {Promise<{ok: true, refreshed: string[], seed: string|null, ticketText?: string}|{ok: false, error: string}>}
|
|
415
443
|
*/
|
|
416
|
-
export function refreezeUrlInputs({ into, fetchUrl }: {
|
|
444
|
+
export function refreezeUrlInputs({ into, fetchUrl, ticket }: {
|
|
417
445
|
into: string;
|
|
418
446
|
fetchUrl?: (url: string) => Promise<{
|
|
419
447
|
ok: true;
|
|
@@ -423,10 +451,18 @@ export function refreezeUrlInputs({ into, fetchUrl }: {
|
|
|
423
451
|
ok: false;
|
|
424
452
|
error: string;
|
|
425
453
|
}>;
|
|
454
|
+
ticket?: {
|
|
455
|
+
number: number;
|
|
456
|
+
mcp: {
|
|
457
|
+
server: string;
|
|
458
|
+
tools: string[];
|
|
459
|
+
};
|
|
460
|
+
};
|
|
426
461
|
}): Promise<{
|
|
427
462
|
ok: true;
|
|
428
463
|
refreshed: string[];
|
|
429
464
|
seed: string | null;
|
|
465
|
+
ticketText?: string;
|
|
430
466
|
} | {
|
|
431
467
|
ok: false;
|
|
432
468
|
error: string;
|