projectkeeper 0.0.0-stage → 1.0.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 +56 -0
- package/LICENSE +21 -0
- package/README.md +283 -2
- package/README.zh-CN.md +285 -0
- package/THIRD_PARTY_NOTICES.md +53 -0
- package/bin/pk.mjs +6 -0
- package/bin/postinstall.mjs +5 -0
- package/bin/strip-types.mjs +28 -0
- package/package.json +68 -4
- package/patches/README.md +111 -0
- package/patches/pi-ai-0.85.0.ts +122 -0
- package/patches/pi-ai-0.87.1.ts +122 -0
- package/scripts/apply-pi-streaming-patch.ts +86 -0
- package/skills/clerk/coverage/SKILL.md +35 -0
- package/skills/clerk/cross-check/SKILL.md +118 -0
- package/skills/clerk/deepen-dispatch/SKILL.md +69 -0
- package/skills/clerk/lane-follow-up/SKILL.md +94 -0
- package/skills/clerk/lane-plan/SKILL.md +107 -0
- package/skills/clerk/lane-slot/SKILL.md +113 -0
- package/skills/clerk/lane-topic/SKILL.md +116 -0
- package/skills/clerk/orientation/SKILL.md +160 -0
- package/skills/clerk/reconcile/SKILL.md +77 -0
- package/skills/clerk/skeleton-dispatch/SKILL.md +43 -0
- package/skills/clerk/spot-check/SKILL.md +52 -0
- package/skills/clerk/synthesis/SKILL.md +65 -0
- package/skills/table-follow-up/SKILL.md +42 -0
- package/src/cli.ts +319 -0
- package/src/codemap/README.md +13 -0
- package/src/codemap/engines.ts +102 -0
- package/src/codemap/facts.ts +504 -0
- package/src/context/agent-entry.ts +232 -0
- package/src/context/ask.ts +97 -0
- package/src/context/assemble.ts +1058 -0
- package/src/context/code-source.ts +103 -0
- package/src/context/k-briefs.ts +114 -0
- package/src/context/lineage.ts +100 -0
- package/src/context/object-brief.ts +300 -0
- package/src/context/owner-words.ts +191 -0
- package/src/context/pack-fixture.ts +342 -0
- package/src/context/project-rules.ts +160 -0
- package/src/intake/intake.ts +392 -0
- package/src/intake/material-rules.ts +166 -0
- package/src/intake/removal.ts +316 -0
- package/src/intake/skipped.ts +72 -0
- package/src/keeper/adjustment.ts +565 -0
- package/src/keeper/bounds/boundary.ts +509 -0
- package/src/keeper/bounds/command.ts +1665 -0
- package/src/keeper/bounds/paths.ts +164 -0
- package/src/keeper/bounds/reads.ts +718 -0
- package/src/keeper/bounds/shell-write-guard.ts +521 -0
- package/src/keeper/capabilities.ts +136 -0
- package/src/keeper/clerk-steps.ts +151 -0
- package/src/keeper/clerk-tools.ts +1424 -0
- package/src/keeper/conversation.ts +253 -0
- package/src/keeper/evidence.ts +662 -0
- package/src/keeper/fake-provider.ts +132 -0
- package/src/keeper/held.ts +15 -0
- package/src/keeper/history-tools.ts +163 -0
- package/src/keeper/jobs/answering.ts +53 -0
- package/src/keeper/key-check.ts +105 -0
- package/src/keeper/ledger-tools.ts +295 -0
- package/src/keeper/link-check.ts +185 -0
- package/src/keeper/merge.ts +260 -0
- package/src/keeper/note-origin.ts +56 -0
- package/src/keeper/numbers-check.ts +102 -0
- package/src/keeper/open-in-pi.ts +57 -0
- package/src/keeper/organize/absence.ts +266 -0
- package/src/keeper/organize/carried-on.ts +214 -0
- package/src/keeper/organize/clerk-coverage.ts +293 -0
- package/src/keeper/organize/clerk-prompts.ts +132 -0
- package/src/keeper/organize/clerk.ts +1395 -0
- package/src/keeper/organize/coverage-gate.ts +19 -0
- package/src/keeper/organize/coverage-tools.ts +765 -0
- package/src/keeper/organize/entries.ts +153 -0
- package/src/keeper/organize/entry-gate.ts +289 -0
- package/src/keeper/organize/fill-tools.ts +718 -0
- package/src/keeper/organize/follow-up.ts +280 -0
- package/src/keeper/organize/generation-check.ts +504 -0
- package/src/keeper/organize/graph.ts +230 -0
- package/src/keeper/organize/lane-tools.ts +289 -0
- package/src/keeper/organize/looked-tools.ts +54 -0
- package/src/keeper/organize/materials.ts +243 -0
- package/src/keeper/organize/owner-lines.ts +493 -0
- package/src/keeper/organize/place-tools.ts +216 -0
- package/src/keeper/organize/placement-inference.ts +1045 -0
- package/src/keeper/organize/placement-time.ts +320 -0
- package/src/keeper/organize/placing.ts +821 -0
- package/src/keeper/organize/positioning.ts +33 -0
- package/src/keeper/organize/readiness.ts +47 -0
- package/src/keeper/organize/reading.ts +401 -0
- package/src/keeper/organize/round-blocks.ts +65 -0
- package/src/keeper/organize/round-news.ts +164 -0
- package/src/keeper/organize/round-open.ts +586 -0
- package/src/keeper/organize/schedule-state.ts +39 -0
- package/src/keeper/organize/schedule.ts +137 -0
- package/src/keeper/organize/service.ts +409 -0
- package/src/keeper/organize/skills.ts +116 -0
- package/src/keeper/organize/slots.ts +85 -0
- package/src/keeper/organize/stage-gate.ts +175 -0
- package/src/keeper/organize/stage-tools.ts +471 -0
- package/src/keeper/organize/standing-notes.ts +141 -0
- package/src/keeper/organize/table-follow-up.ts +330 -0
- package/src/keeper/organize/takeover-clerk.ts +832 -0
- package/src/keeper/organize/takeover-state.ts +103 -0
- package/src/keeper/organize/takeover.ts +216 -0
- package/src/keeper/organize/update-pending.ts +535 -0
- package/src/keeper/organize/workbench-placement.ts +92 -0
- package/src/keeper/own-keys.ts +114 -0
- package/src/keeper/owner-text.ts +165 -0
- package/src/keeper/project-folder.ts +334 -0
- package/src/keeper/prompts.ts +101 -0
- package/src/keeper/references.ts +177 -0
- package/src/keeper/relook/compose.ts +120 -0
- package/src/keeper/relook/prompts.ts +36 -0
- package/src/keeper/roles.ts +259 -0
- package/src/keeper/round-tools.ts +227 -0
- package/src/keeper/route.ts +148 -0
- package/src/keeper/rules.ts +97 -0
- package/src/keeper/runtime.ts +1858 -0
- package/src/keeper/scope-tools.ts +194 -0
- package/src/keeper/sendback-text.ts +83 -0
- package/src/keeper/step-timing.ts +207 -0
- package/src/keeper/testing/clerk-script.ts +212 -0
- package/src/keeper/testing/streaming-arguments.ts +57 -0
- package/src/keeper/tools.ts +2340 -0
- package/src/keeper/utterance-tools.ts +64 -0
- package/src/keeper/verbatim.ts +397 -0
- package/src/ledger/adapters.ts +186 -0
- package/src/ledger/arrangements.ts +257 -0
- package/src/ledger/blame.ts +58 -0
- package/src/ledger/code-engine-child.ts +69 -0
- package/src/ledger/code-engine.ts +548 -0
- package/src/ledger/code.ts +607 -0
- package/src/ledger/docs.ts +294 -0
- package/src/ledger/git-read.ts +321 -0
- package/src/ledger/index.ts +1850 -0
- package/src/ledger/item-range.ts +16 -0
- package/src/ledger/lines.ts +328 -0
- package/src/ledger/numbering.ts +269 -0
- package/src/ledger/ranges.ts +74 -0
- package/src/ledger/rebuild-worker.ts +15 -0
- package/src/ledger/rebuild.ts +387 -0
- package/src/ledger/repo-scan.ts +181 -0
- package/src/ledger/schema.ts +450 -0
- package/src/ledger/sessions.ts +134 -0
- package/src/ledger/text-scan.ts +466 -0
- package/src/ledger/time.ts +185 -0
- package/src/ledger/ts-symbols.ts +180 -0
- package/src/ledger/views.ts +377 -0
- package/src/mcp/server.ts +127 -0
- package/src/mcp/tools.ts +187 -0
- package/src/model/ids.ts +23 -0
- package/src/model/k-types.ts +912 -0
- package/src/model/time.ts +85 -0
- package/src/model/types.ts +1382 -0
- package/src/model/views-k.ts +707 -0
- package/src/model/vocab.ts +269 -0
- package/src/process/analysis.ts +79 -0
- package/src/process/breakpoint-candidates.ts +383 -0
- package/src/process/breakpoints.ts +746 -0
- package/src/process/claim-check.ts +295 -0
- package/src/process/delivery-links.ts +52 -0
- package/src/process/facts.ts +487 -0
- package/src/process/generations.ts +138 -0
- package/src/process/index.ts +243 -0
- package/src/process/integration.ts +128 -0
- package/src/process/placement.ts +107 -0
- package/src/process/plan.ts +276 -0
- package/src/process/sendbacks.ts +244 -0
- package/src/process/text.ts +185 -0
- package/src/process/units.ts +543 -0
- package/src/process/unnumbered.ts +431 -0
- package/src/process/work.ts +884 -0
- package/src/scope/candidates.ts +86 -0
- package/src/scope/decisions.ts +229 -0
- package/src/scope/discover.ts +741 -0
- package/src/scope/ignore.ts +126 -0
- package/src/scope/ignored-place.ts +93 -0
- package/src/scope/skip.ts +161 -0
- package/src/scope/toolchain.ts +180 -0
- package/src/scope/worktree.ts +187 -0
- package/src/server/api.ts +549 -0
- package/src/server/app.ts +595 -0
- package/src/server/drafts-api.ts +170 -0
- package/src/server/folders-api.ts +243 -0
- package/src/server/graph-view.ts +639 -0
- package/src/server/http.ts +224 -0
- package/src/server/k-agent-api.ts +56 -0
- package/src/server/k-rounds-d99.ts +91 -0
- package/src/server/k-views.ts +405 -0
- package/src/server/keeper-page.ts +446 -0
- package/src/server/keys-api.ts +239 -0
- package/src/server/project-folder-api.ts +104 -0
- package/src/server/vendor.ts +14 -0
- package/src/server/workbench-content.ts +561 -0
- package/src/sources/anchor.ts +129 -0
- package/src/sources/files.ts +267 -0
- package/src/sources/gitobs.ts +41 -0
- package/src/sources/history.ts +231 -0
- package/src/sources/scan-worker.ts +10 -0
- package/src/sources/sessions/locate.ts +292 -0
- package/src/sources/sessions/read.ts +346 -0
- package/src/sources/sessions/scope.ts +42 -0
- package/src/sources/sessions/utterances.ts +223 -0
- package/src/sources/watch.ts +215 -0
- package/src/store/json-file.ts +50 -0
- package/src/store/paths.ts +39 -0
- package/src/store/project-store.ts +295 -0
- package/src/store/versions.ts +172 -0
- package/src/store/workspace.ts +216 -0
- package/src/table/check.ts +333 -0
- package/src/table/follow-up-tools.ts +30 -0
- package/src/table/follow-up.ts +344 -0
- package/src/table/import.ts +610 -0
- package/src/table/project-home.ts +61 -0
- package/src/table/sessions.ts +168 -0
- package/src/table/takeover.ts +483 -0
- package/src/util/git-check.ts +29 -0
- package/src/util/git.ts +411 -0
- package/src/util/own-ts.ts +15 -0
- package/src/util/paths.ts +225 -0
- package/template/FILLING-IN.md +148 -0
- package/template/examples/papertrail.json +747 -0
- package/template/projectkeeper.schema.json +1001 -0
- package/ui/app.js +1135 -0
- package/ui/failures.js +82 -0
- package/ui/flyout.js +120 -0
- package/ui/folder-chooser.js +264 -0
- package/ui/glossary.js +156 -0
- package/ui/graph-fit.js +157 -0
- package/ui/graph-material.js +61 -0
- package/ui/graph-palette.js +109 -0
- package/ui/graph-tools.js +62 -0
- package/ui/graph.js +1712 -0
- package/ui/index.html +31 -0
- package/ui/k/code-view.js +230 -0
- package/ui/k/draft-view.js +93 -0
- package/ui/k/k-views.css +224 -0
- package/ui/k/round-tree.js +450 -0
- package/ui/k/scope-k.js +159 -0
- package/ui/k-data.js +118 -0
- package/ui/k-fold.js +106 -0
- package/ui/k-process.css +302 -0
- package/ui/k-process.js +934 -0
- package/ui/keeper-activity.js +175 -0
- package/ui/keeper-view.js +801 -0
- package/ui/keeper.css +101 -0
- package/ui/key-order.js +62 -0
- package/ui/list-fold.js +67 -0
- package/ui/markdown.d.ts +21 -0
- package/ui/markdown.js +472 -0
- package/ui/placement.d.ts +92 -0
- package/ui/placement.js +445 -0
- package/ui/popover-place.d.ts +16 -0
- package/ui/popover-place.js +89 -0
- package/ui/popover.js +198 -0
- package/ui/project-folder.js +37 -0
- package/ui/shell-state.js +40 -0
- package/ui/strip-rows.js +171 -0
- package/ui/styles.css +492 -0
- package/ui/theme-pick.js +36 -0
- package/ui/theme.js +74 -0
- package/ui/themes/LICENSE.md +13 -0
- package/ui/themes/README.md +44 -0
- package/ui/themes/TOKENS.md +291 -0
- package/ui/themes/a1/board.css +1557 -0
- package/ui/themes/a1/pk.css +392 -0
- package/ui/themes/b1/board.css +1163 -0
- package/ui/themes/b1/pk.css +218 -0
- package/ui/themes/d2/board.css +518 -0
- package/ui/themes/d2/pk.css +243 -0
- package/ui/themes/guard.css +73 -0
- package/ui/themes/i1/board.css +776 -0
- package/ui/themes/i1/pk.css +223 -0
- package/ui/themes/manifest.json +13 -0
- package/ui/views.js +2796 -0
|
@@ -0,0 +1,912 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Increment K assets (Spec v3.0 §1.16–§1.19, §2.11–§2.13, §3.3, §3.11): what the clerk method places on the workbench
|
|
3
|
+
* and the markers that hang on objects. The ledger itself — the program-built facts — lives in `src/ledger`; the records
|
|
4
|
+
* here are either judgements written on a fixed workbench position, or program-computed markers kept so the owner's
|
|
5
|
+
* responses and their history stay with them.
|
|
6
|
+
*
|
|
7
|
+
* Every record carries when its subject happened (`Occurred`, taken from the source by the program, never written by the
|
|
8
|
+
* model; §2.11) apart from when the Keeper wrote it (`updatedAt`, the old `As of`).
|
|
9
|
+
*/
|
|
10
|
+
import type { Basis, TakeoverDepth } from './vocab.ts';
|
|
11
|
+
|
|
12
|
+
// ───────────────────────── §2.11 when it happened ─────────────────────────
|
|
13
|
+
|
|
14
|
+
export type OccurredBasis = 'Commit' | 'Session' | 'Written in text' | 'File time' | 'First observed';
|
|
15
|
+
|
|
16
|
+
export interface Occurred {
|
|
17
|
+
/** ISO date or date-time at the precision the source gives: a date stays a date (§1.8). */
|
|
18
|
+
readonly at: string;
|
|
19
|
+
readonly basis: OccurredBasis;
|
|
20
|
+
/** The ledger entry or source that gives the time. */
|
|
21
|
+
readonly anchor: string | null;
|
|
22
|
+
/** When two times disagree (the text says one day, the commit another) both are kept and shown (§2.11). */
|
|
23
|
+
readonly other?: { readonly at: string; readonly basis: OccurredBasis; readonly anchor: string | null } | null;
|
|
24
|
+
/** No time in the source: shown as `Undated · first seen <at>` and sorted by first observation (§2.11). */
|
|
25
|
+
readonly undated?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* CN (E152; Spec §2.12 没有痕迹,要读过才算): what an absence claim rests on — where it was looked for and up to when. A
|
|
30
|
+
* note, a mark or a send-back that says something has no follow-up, was let pass or was taken up by nobody carries it,
|
|
31
|
+
* as a breakpoint candidate carries where a lane looked (keeper/organize/absence.ts).
|
|
32
|
+
*/
|
|
33
|
+
export interface AbsenceLooked {
|
|
34
|
+
/** Each place read, as the spot-check can open it again: a file with its section or lines, a ledger query, a commit range, a session. */
|
|
35
|
+
readonly where: readonly string[];
|
|
36
|
+
/** Up to when the reading reaches: the date or time of the newest commit, document version or report read. */
|
|
37
|
+
readonly upTo: string;
|
|
38
|
+
/** When sessions were read: the time of the last session message read. */
|
|
39
|
+
readonly sessionsUpTo?: string | null;
|
|
40
|
+
readonly roundId: string | null;
|
|
41
|
+
readonly jobId: string | null;
|
|
42
|
+
readonly at: string;
|
|
43
|
+
/** Null when the look reached the ledger's present as it was written; else what lay beyond it, in words. */
|
|
44
|
+
readonly behind: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** One piece of evidence as the workbench names it: a ledger entry, a source, a commit, a file or another object. */
|
|
48
|
+
export interface EvidenceRef {
|
|
49
|
+
readonly kind: 'ledger' | 'source' | 'commit' | 'file' | 'object';
|
|
50
|
+
/** Ledger entry id, source id, full commit hash, repository-relative path, or object id. */
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly label: string;
|
|
53
|
+
/** The original line, verbatim, when the evidence is one line (a verdict, a rule, a heading). */
|
|
54
|
+
readonly line?: string | null;
|
|
55
|
+
readonly occurred?: Occurred | null;
|
|
56
|
+
/** The repository it is in, when the project has more than one (a file's path is repository-relative). */
|
|
57
|
+
readonly repo?: string | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** §2.13: the six things the owner judges. 1 stale · 2 drift · 3 dropped along the way · 4 grown by itself · 5 let pass · 6 looks residual. */
|
|
61
|
+
export type SixThing = 1 | 2 | 3 | 4 | 5 | 6;
|
|
62
|
+
|
|
63
|
+
/** The owner's `No action needed` on a breakpoint or a send-back (§1.18, §2.12): it stops lighting up; the response stays. */
|
|
64
|
+
export interface NoActionNeeded {
|
|
65
|
+
readonly text: 'No action needed';
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
readonly at: string;
|
|
68
|
+
readonly sourceId: string | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ───────────────────────── §2.12 the process of a piece of work ─────────────────────────
|
|
72
|
+
|
|
73
|
+
export type StepKind =
|
|
74
|
+
| 'Planned' | 'Dispatched' | 'Delivered' | 'QC' | 'Review' | 'Walkthrough' | 'Fix' | 'Merged' | 'Accepted'
|
|
75
|
+
| 'Handed in' | 'Handed to';
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A link between a work item and a ledger entry that the program could not make from ids alone, judged by a step of the
|
|
79
|
+
* round (§1.4: the model adds the associations the program cannot see) and confirmed by the cross-check (§3.3 step 4).
|
|
80
|
+
*/
|
|
81
|
+
export interface ProcessLink {
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly projectId: string;
|
|
84
|
+
readonly workId: string;
|
|
85
|
+
readonly ledgerRef: string;
|
|
86
|
+
/** The ledger entry as the evidence it is: label, the original line, its time. */
|
|
87
|
+
readonly evidence?: EvidenceRef | null;
|
|
88
|
+
readonly stepKind: StepKind;
|
|
89
|
+
readonly why: string;
|
|
90
|
+
readonly basis: 'Inferred';
|
|
91
|
+
readonly confirmed: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The program's check of the link's evidence when it was written (CM): the fact resolves, a commit is in the ledger and
|
|
94
|
+
* touches what the link claims, a cited line stands in its source. A link that passed is "lane-checked" and counts like a
|
|
95
|
+
* confirmed one, the distinction kept visible; one that failed is suspect until the cross-check confirms or rejects it.
|
|
96
|
+
* Absent on links written before the check.
|
|
97
|
+
*/
|
|
98
|
+
readonly check?: LinkCheck | null;
|
|
99
|
+
readonly roundId: string | null;
|
|
100
|
+
readonly jobId: string | null;
|
|
101
|
+
readonly at: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** The program's check of a link's evidence (CM): passed or not, why, and when. */
|
|
105
|
+
export interface LinkCheck {
|
|
106
|
+
readonly passed: boolean;
|
|
107
|
+
readonly why: string;
|
|
108
|
+
readonly at: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** How far a link stands (CM): confirmed by the cross-check, lane-checked by the program, suspect, or not checked yet. */
|
|
112
|
+
export type LinkStanding = 'confirmed' | 'lane-checked' | 'suspect' | 'unconfirmed';
|
|
113
|
+
export const linkStanding = (l: Pick<ProcessLink, 'confirmed' | 'check'>): LinkStanding =>
|
|
114
|
+
l.confirmed ? 'confirmed' : l.check?.passed === true ? 'lane-checked' : l.check?.passed === false ? 'suspect' : 'unconfirmed';
|
|
115
|
+
/** A link that counts for the process and the breakpoints: confirmed, or lane-checked (CM). */
|
|
116
|
+
export const linkHolds = (l: Pick<ProcessLink, 'confirmed' | 'check'>): boolean => l.confirmed || l.check?.passed === true;
|
|
117
|
+
|
|
118
|
+
export type BreakpointKind =
|
|
119
|
+
| 'Not planned' | 'Not started' | 'Not merged' | 'No trace of done' | 'Not checked' | 'Findings open'
|
|
120
|
+
| 'Passed with open items' | 'Fix not re-checked' | 'No plan' | 'Downstream behind' | 'Not carried out';
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* §2.12 a next step that should be there and has no trace. An observation hanging on an object, not a ticket: later
|
|
124
|
+
* evidence puts it out by itself; the owner's `No action needed` stops it lighting up. Whether the next step is due
|
|
125
|
+
* follows the project's own rules (§1.15): ProjectKeeper adds no steps to a project.
|
|
126
|
+
*/
|
|
127
|
+
export interface Breakpoint {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly projectId: string;
|
|
130
|
+
readonly kind: BreakpointKind;
|
|
131
|
+
readonly targetId: string;
|
|
132
|
+
/** One sentence: which step has no trace. */
|
|
133
|
+
readonly why: string;
|
|
134
|
+
readonly evidence: readonly EvidenceRef[];
|
|
135
|
+
/** `Explicit` when the ledger's ids alone show it; `Inferred` when it rests on a judged link (§2.12). */
|
|
136
|
+
readonly basis: Basis;
|
|
137
|
+
/** When the missing step became due. */
|
|
138
|
+
readonly since: Occurred;
|
|
139
|
+
readonly lit: boolean;
|
|
140
|
+
/** Put out: by later evidence the program found, by the owner, or by a step of a round that refuted it with evidence. */
|
|
141
|
+
readonly out: { readonly at: string; readonly by: 'evidence' | 'owner' | 'model'; readonly evidence: readonly EvidenceRef[];
|
|
142
|
+
/** The confirmation that refuted this family, including a refutation inherited by another downstream object. */
|
|
143
|
+
readonly decision?: { readonly breakpointId: string; readonly at: string; readonly roundId: string | null };
|
|
144
|
+
} | null;
|
|
145
|
+
/** A Downstream behind family is identified by the exact ledger line, its reading, and the old side. */
|
|
146
|
+
readonly familyBasis?: { readonly lineId: string; readonly syntax: string; readonly replaced: string };
|
|
147
|
+
/** Past model refutations survive even if another basis temporarily lights the same target. */
|
|
148
|
+
readonly familyRefutations?: readonly { readonly basis: NonNullable<Breakpoint['familyBasis']>;
|
|
149
|
+
readonly decision: { readonly breakpointId: string; readonly at: string; readonly roundId: string | null };
|
|
150
|
+
readonly evidence: readonly EvidenceRef[] }[];
|
|
151
|
+
readonly ownerResponse: NoActionNeeded | null;
|
|
152
|
+
/**
|
|
153
|
+
* A lane looked for the missing step and did not find it (D99; Spec §2.12: 没有痕迹,要读过才算): where it looked.
|
|
154
|
+
* Kept while the candidate still holds on the same evidence; absent or null until a lane has looked.
|
|
155
|
+
*/
|
|
156
|
+
readonly looked?: { readonly roundId: string; readonly jobId: string | null; readonly where: readonly string[]; readonly at: string } | null;
|
|
157
|
+
/** The independent check (the round's spot-check) confirmed it after a lane had looked: only then is it lit (D99). */
|
|
158
|
+
readonly checked?: { readonly roundId: string; readonly jobId: string | null; readonly at: string } | null;
|
|
159
|
+
readonly confirmedInRoundId: string | null;
|
|
160
|
+
readonly sixThing: SixThing | null;
|
|
161
|
+
readonly sendBackId: string | null;
|
|
162
|
+
readonly roundId: string | null;
|
|
163
|
+
readonly updatedAt: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ───────────────────────── §1.18 send-backs ─────────────────────────
|
|
167
|
+
|
|
168
|
+
export type SendBackStage = 'Suggested' | 'Returned' | 'Closed';
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* §1.18 a relation, not a ticket: a gap, a failure or a problem nobody handled goes back to Work; drift and staleness go
|
|
172
|
+
* back to Plan. `Returned` and `Closed` are recognised from the ledger at the next Follow up, never set by hand.
|
|
173
|
+
*/
|
|
174
|
+
export interface SendBack {
|
|
175
|
+
readonly id: string;
|
|
176
|
+
readonly projectId: string;
|
|
177
|
+
readonly to: 'Work' | 'Plan';
|
|
178
|
+
readonly stage: SendBackStage;
|
|
179
|
+
readonly targetId: string;
|
|
180
|
+
/** Where the problem is. */
|
|
181
|
+
readonly what: string;
|
|
182
|
+
/** Where it should go back to: reopen or new work; a plan or document change. */
|
|
183
|
+
readonly suggestion: string;
|
|
184
|
+
readonly evidence: readonly EvidenceRef[];
|
|
185
|
+
readonly from: { readonly kind: 'breakpoint' | 'verdict' | 'owner-judgement' | 'code-anomaly'; readonly id: string };
|
|
186
|
+
readonly returned: { readonly by: EvidenceRef; readonly at: string; readonly basis: Basis } | null;
|
|
187
|
+
readonly closed: { readonly by: EvidenceRef; readonly at: string } | null;
|
|
188
|
+
readonly ownerResponse: NoActionNeeded | null;
|
|
189
|
+
readonly sixThing: SixThing | null;
|
|
190
|
+
/** CN: what was read before it was judged dropped along the way or let pass (keeper/organize/absence.ts). */
|
|
191
|
+
readonly looked?: AbsenceLooked | null;
|
|
192
|
+
/** When the problem it answers happened. */
|
|
193
|
+
readonly occurred: Occurred;
|
|
194
|
+
readonly roundId: string | null;
|
|
195
|
+
readonly updatedAt: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ───────────────────────── §1.17 the project folder: semantic patches, Keeper numbers ─────────────────────────
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* §1.17 what a docs change of meaning withdrew and what took its place. Recognised from the ledger's explicit
|
|
202
|
+
* supersessions (§1.16), numbered by the Keeper; the patch cites the decision and does not repeat its reasons.
|
|
203
|
+
*/
|
|
204
|
+
export interface SemanticPatch {
|
|
205
|
+
readonly id: string;
|
|
206
|
+
readonly projectId: string;
|
|
207
|
+
/** The Keeper's number (the project's own number wins when the project numbers these). */
|
|
208
|
+
readonly number: string;
|
|
209
|
+
readonly title: string;
|
|
210
|
+
/** Which part of the old state no longer holds. */
|
|
211
|
+
readonly invalidated: string;
|
|
212
|
+
/** What replaces it. */
|
|
213
|
+
readonly replacedBy: string;
|
|
214
|
+
/** Who is affected: object ids (documents, plans, work items, code territories) … */
|
|
215
|
+
readonly affects: readonly string[];
|
|
216
|
+
/** … and in words. */
|
|
217
|
+
readonly affectsText: string;
|
|
218
|
+
/** What must never again pass as current. */
|
|
219
|
+
readonly mustNotPassAsCurrent: string;
|
|
220
|
+
readonly oldAnchor: EvidenceRef;
|
|
221
|
+
readonly newAnchor: EvidenceRef | null;
|
|
222
|
+
/** The decision or commit that replaced it. */
|
|
223
|
+
readonly decision: EvidenceRef | null;
|
|
224
|
+
/** The ledger's explicit-supersession entry it came from. */
|
|
225
|
+
readonly candidate: EvidenceRef;
|
|
226
|
+
/** Only part of the old state is withdrawn; the rest stays current (CKC-26 AC-2). */
|
|
227
|
+
readonly partial: boolean;
|
|
228
|
+
readonly occurred: Occurred;
|
|
229
|
+
/** The skeleton drafts it, the cross-check confirms or rejects it (§3.3). */
|
|
230
|
+
readonly status: 'Draft' | 'Confirmed' | 'Rejected';
|
|
231
|
+
readonly writtenToFolder: { readonly path: string; readonly commit: string | null; readonly at: string } | null;
|
|
232
|
+
readonly roundId: string | null;
|
|
233
|
+
readonly jobId: string | null;
|
|
234
|
+
readonly updatedAt: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** §1.17 a number the Keeper gave to something the project did not number (D72). */
|
|
238
|
+
export interface KeeperNumber {
|
|
239
|
+
readonly id: string;
|
|
240
|
+
readonly projectId: string;
|
|
241
|
+
readonly number: string;
|
|
242
|
+
readonly objectId: string;
|
|
243
|
+
readonly objectKind: 'work' | 'decision' | 'patch' | 'other';
|
|
244
|
+
/** Once the project numbers it itself, the project's number wins and the Keeper's stays as an alias. */
|
|
245
|
+
readonly projectNumber: string | null;
|
|
246
|
+
readonly at: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ───────────────────────── §3.11 session drafts ─────────────────────────
|
|
250
|
+
|
|
251
|
+
export type OwnerLineKind = 'Chat' | 'Decision' | 'Confirmation';
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* §3.11, D88: one per session. The owner's words verbatim, each marked chat or decision (a confirmation is a decision);
|
|
255
|
+
* the agents' intents and reports summarised as claims. The ground the owner's words, the lineage, the deep sweeps and
|
|
256
|
+
* the Keeper's recall stand on; not necessarily on the workbench, openable when a session is drilled into.
|
|
257
|
+
*/
|
|
258
|
+
export interface SessionDraft {
|
|
259
|
+
readonly id: string;
|
|
260
|
+
readonly projectId: string;
|
|
261
|
+
readonly session: { readonly host: string; readonly sessionId: string; readonly file: string; readonly startedAt: string; readonly endedAt: string };
|
|
262
|
+
readonly ownerLines: readonly {
|
|
263
|
+
/** The ledger's message id. */
|
|
264
|
+
readonly ref: string;
|
|
265
|
+
readonly at: string;
|
|
266
|
+
/** Verbatim. */
|
|
267
|
+
readonly text: string;
|
|
268
|
+
/** Null until judged. */
|
|
269
|
+
readonly kind: OwnerLineKind | null;
|
|
270
|
+
/** For a short confirmation: the agent message it answers (verbatim excerpt), taken by the program. */
|
|
271
|
+
readonly answers: string | null;
|
|
272
|
+
/** What the owner confirmed, in the Keeper's words: "the owner confirmed X's proposal to …" (§3.11). */
|
|
273
|
+
readonly confirms: string | null;
|
|
274
|
+
}[];
|
|
275
|
+
/** Agents' intents and reports, as claims: who, when, what they said they did or meant to do. */
|
|
276
|
+
readonly agentSummary: readonly { readonly at: string; readonly who: string; readonly summary: string }[];
|
|
277
|
+
/** The job that wrote this version of the draft. */
|
|
278
|
+
readonly jobId: string | null;
|
|
279
|
+
readonly at: string;
|
|
280
|
+
/**
|
|
281
|
+
* Every job that wrote the draft, oldest first, and the round it was a step of: a session drafted in one round and
|
|
282
|
+
* drafted again in a later one is listed under both rounds' session-drafts step (CKC-23 AC-18). Absent on drafts
|
|
283
|
+
* written before it was kept; `jobId` then names the one writer known.
|
|
284
|
+
*/
|
|
285
|
+
readonly writtenBy?: readonly { readonly jobId: string | null; readonly roundId: string | null; readonly at: string }[];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ───────────────────────── §1.19 code territories ─────────────────────────
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* §1.19 (D85), whether the current plan still uses a territory's code:
|
|
292
|
+
* - `In current plan`: current code references it, and current work or requirements point at it — a work item of the
|
|
293
|
+
* current generation changed it, or the area it serves has current requirements, designs, decisions, plans or work;
|
|
294
|
+
* - `In use, not in current plan`: current code references it, and nothing current in the plan points at it (QC AY: the
|
|
295
|
+
* first value used to be given on the references alone, which promised more than was checked);
|
|
296
|
+
* - `Previous generation only`: only code that is almost all an earlier generation's still references it;
|
|
297
|
+
* - `Unreferenced`: nothing reaches it from an entry point or current work;
|
|
298
|
+
* - `Not known`: the territory holds no file in a language the ledger resolves dependencies for (§1.16), so nothing is
|
|
299
|
+
* claimed about its use either way.
|
|
300
|
+
* The values are computed when the `Code` view is assembled and never stored.
|
|
301
|
+
*/
|
|
302
|
+
export type CurrentUse = 'In current plan' | 'In use, not in current plan' | 'Previous generation only' | 'Unreferenced' | 'Not known';
|
|
303
|
+
export type TerritoryAnomalyKind = 'Unreferenced' | 'Looks residual, is live' | 'Built without a claiming work item' | 'Docs disagree';
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* §1.19 the judged half of a code territory: its name, what it is for, the area it serves, the anomalies. The numbers —
|
|
307
|
+
* size, dependencies, who built it, which generation, tests, last change, current use — come from the ledger when the
|
|
308
|
+
* `Code` view is assembled, so they are always the current version's.
|
|
309
|
+
*/
|
|
310
|
+
export interface CodeTerritory {
|
|
311
|
+
readonly id: string;
|
|
312
|
+
readonly projectId: string;
|
|
313
|
+
readonly name: string;
|
|
314
|
+
readonly summary: string;
|
|
315
|
+
readonly repo: string;
|
|
316
|
+
/** Repository-relative directories or files that make it up. */
|
|
317
|
+
readonly paths: readonly string[];
|
|
318
|
+
readonly kind: 'area' | 'shared' | 'non-product';
|
|
319
|
+
/** The area (reference id) it mainly serves; null for shared and non-product code. */
|
|
320
|
+
readonly areaId: string | null;
|
|
321
|
+
/** Other areas it also serves: shown as "also serves N", expanded on hover (D74, D54). */
|
|
322
|
+
readonly alsoServes: readonly string[];
|
|
323
|
+
readonly anomalies: readonly {
|
|
324
|
+
readonly kind: TerritoryAnomalyKind;
|
|
325
|
+
readonly text: string;
|
|
326
|
+
readonly evidence: readonly EvidenceRef[];
|
|
327
|
+
readonly basis: Basis;
|
|
328
|
+
readonly sendBackId: string | null;
|
|
329
|
+
readonly noteIds: readonly string[];
|
|
330
|
+
/** The one of the six things it is material for (§2.13; `Looks residual` is 6). */
|
|
331
|
+
readonly sixThing?: SixThing | null;
|
|
332
|
+
}[];
|
|
333
|
+
readonly roundId: string | null;
|
|
334
|
+
readonly jobId: string | null;
|
|
335
|
+
readonly updatedAt: string;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// ───────────────────────── §2.12 generations of the plan ─────────────────────────
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* §2.12, D85: an earlier generation of plans, cut only where the material says a version, restart, cleanup or decision
|
|
342
|
+
* ended it (D25). Shown rolled up before the current plan; unrolled it reads like the current generation.
|
|
343
|
+
*/
|
|
344
|
+
export interface Generation {
|
|
345
|
+
readonly id: string;
|
|
346
|
+
readonly projectId: string;
|
|
347
|
+
/** The material's own name for it, e.g. "Module v0.2–v0.3". */
|
|
348
|
+
readonly name: string;
|
|
349
|
+
readonly started: Occurred | null;
|
|
350
|
+
readonly ended: Occurred;
|
|
351
|
+
/** The decision, cleanup or restart that ended it. */
|
|
352
|
+
readonly endedBy: EvidenceRef;
|
|
353
|
+
/** Its plan documents; deleted ones are read from the commit before their deletion (D82). */
|
|
354
|
+
readonly planRefs: readonly EvidenceRef[];
|
|
355
|
+
/** The work items planned in it. */
|
|
356
|
+
readonly workIds: readonly string[];
|
|
357
|
+
readonly roundId: string | null;
|
|
358
|
+
readonly updatedAt: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ───────────────────────── §3.3 orientation: which file is which layer ─────────────────────────
|
|
362
|
+
|
|
363
|
+
export type LayerKind =
|
|
364
|
+
| 'Product' | 'PRD' | 'Spec' | 'Plan' | 'Task index' | 'Task contract' | 'Decision record' | 'Execution arrangement'
|
|
365
|
+
| 'QC and receipts' | 'Readme' | 'Instructions' | 'Other';
|
|
366
|
+
|
|
367
|
+
export interface LayerEntry {
|
|
368
|
+
readonly id: string;
|
|
369
|
+
readonly projectId: string;
|
|
370
|
+
readonly repo: string | null;
|
|
371
|
+
readonly path: string;
|
|
372
|
+
readonly layer: LayerKind;
|
|
373
|
+
readonly note: string | null;
|
|
374
|
+
readonly current: boolean;
|
|
375
|
+
readonly roundId: string | null;
|
|
376
|
+
readonly updatedAt: string;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// ───────────────────────── §3.3, §3.10 a round of the clerk method ─────────────────────────
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* The jobs of one round (§3.3). D99: a round is the ledger and the session drafts (the program's groundwork), then `main`
|
|
383
|
+
* — one model job, one pi session, through the stages (`ClerkStage`) — whose `lane` jobs it sends; D103: then `synthesis`,
|
|
384
|
+
* the round's product look-back in a pi session of its own, which the main agent hands over to after its last check; then
|
|
385
|
+
* the independent `spot-check` and the program's `process`. The earlier kinds (`orientation`, `skeleton`, `dig`,
|
|
386
|
+
* `cross-check`) are the rounds before D99, kept so their records read.
|
|
387
|
+
*/
|
|
388
|
+
export type RoundStepKind = 'ledger' | 'session-drafts' | 'orientation' | 'skeleton' | 'dig' | 'cross-check' | 'process' | 'synthesis' | 'spot-check' | 'main' | 'lane';
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The stages the main agent goes through in one session (D99; Spec §3.3): each has a skill. D103: `synthesis` is no
|
|
392
|
+
* stage of the main agent's any more — it is what the main agent hands over to (`pk_stage({ to: "synthesis" })`), a job
|
|
393
|
+
* of its own; the word stays for the rounds recorded before, whose stage log ends with it.
|
|
394
|
+
*/
|
|
395
|
+
export type ClerkStage = 'orientation' | 'skeleton' | 'reconcile' | 'dig' | 'coverage' | 'cross-check' | 'synthesis';
|
|
396
|
+
|
|
397
|
+
/** What a lane answers (D99): a group of slots (first usable), a plan or stage, a topic, or what the coverage check left. */
|
|
398
|
+
export type LaneKind = 'slot' | 'plan' | 'topic' | 'follow-up';
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* A slot a lane may write (D99; Spec §3.3 "工作台是一道填空题"): a kind of position, not an item. `reference:<category>`
|
|
402
|
+
* is the reference items of one category (Goal, Area, Requirement, Design, Decision, Plan, …); the others are the work
|
|
403
|
+
* items with their numbers, the process links, the code territories, the draft semantic patches, the generations, and
|
|
404
|
+
* the relations between items. Every lane may also write its own Report and record where it looked.
|
|
405
|
+
*/
|
|
406
|
+
export type SlotKind = `reference:${string}` | 'threads' | 'links' | 'territories' | 'patches' | 'generations' | 'relations';
|
|
407
|
+
|
|
408
|
+
/** DB: a workbench slot the main agent gave to no lane, with its reason (keeper/organize/slots.ts `SKELETON_SLOTS`). */
|
|
409
|
+
export interface EmptySlot {
|
|
410
|
+
readonly slot: SlotKind;
|
|
411
|
+
readonly why: string;
|
|
412
|
+
readonly at: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** One stage of the main agent's session, as the round records it (§3.10: the time of each). */
|
|
416
|
+
export interface StageEntry {
|
|
417
|
+
readonly stage: ClerkStage;
|
|
418
|
+
readonly startedAt: string;
|
|
419
|
+
readonly endedAt: string | null;
|
|
420
|
+
/** The main job's time spent in this stage; null while it runs. */
|
|
421
|
+
readonly timing: StepTiming | null;
|
|
422
|
+
/** Why the main agent skipped the stages before this one, or left a kind of question without a lane (`pk_stage` why). */
|
|
423
|
+
readonly why?: string | null;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** A lane the main agent sent (D99): its question in its brief, the slots it writes, its job. */
|
|
427
|
+
export interface RoundLane {
|
|
428
|
+
readonly name: string;
|
|
429
|
+
readonly kind: LaneKind;
|
|
430
|
+
/** The lane's brief, a `Brief` round document the main agent wrote before sending it. */
|
|
431
|
+
readonly briefDocId: string;
|
|
432
|
+
readonly slots: readonly SlotKind[];
|
|
433
|
+
readonly jobId: string;
|
|
434
|
+
/** The stage the main agent was in when it sent the lane. */
|
|
435
|
+
readonly stage: ClerkStage;
|
|
436
|
+
readonly sentAt: string;
|
|
437
|
+
/** Its `Report` round document, once written. */
|
|
438
|
+
readonly reportDocId: string | null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/** The main agent's account of a material, or a group of materials, no lane touched (D99 coverage check). */
|
|
442
|
+
export interface MaterialAccount {
|
|
443
|
+
/** Material keys (as the coverage check lists them), or one group (a category, or a category and a directory). */
|
|
444
|
+
readonly keys?: readonly string[];
|
|
445
|
+
readonly group?: string | null;
|
|
446
|
+
readonly outcome: 'not needed' | 'part';
|
|
447
|
+
readonly why: string;
|
|
448
|
+
readonly by: 'main' | 'program';
|
|
449
|
+
readonly at: string;
|
|
450
|
+
/** DA: what the material held that nothing carries when it was accounted for by its key, in the program's words; absent when it held nothing. */
|
|
451
|
+
readonly holds?: string | null;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** DA: one kind of thing a listed group holds that nothing on the workbench carries: how many, and a few of them. */
|
|
455
|
+
export interface HoldCount {
|
|
456
|
+
readonly count: number;
|
|
457
|
+
readonly examples: readonly string[];
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* DA: what a group the coverage check lists holds that nothing carries (keeper/organize/coverage-tools.ts `holdsOf`):
|
|
462
|
+
* stated verdict lines of its documents that no link or fact of a work item cites; numbers its documents define as
|
|
463
|
+
* entries that no item carries and no account names; the owner's lines not looked at yet that its documents quote or
|
|
464
|
+
* its sessions hold. A group that holds any of these is not accounted for as a group.
|
|
465
|
+
*/
|
|
466
|
+
export interface GroupHolds {
|
|
467
|
+
readonly verdictLines?: HoldCount;
|
|
468
|
+
readonly numbers?: HoldCount;
|
|
469
|
+
readonly ownerQuotes?: HoldCount;
|
|
470
|
+
/** The materials of the group that hold any of these, by key. */
|
|
471
|
+
readonly materials: readonly string[];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/** A group of materials the coverage check found no lane touched (D99; the shape `pk_coverage_check` lists them in). */
|
|
475
|
+
export interface CoverageGroup {
|
|
476
|
+
readonly group: string;
|
|
477
|
+
readonly category: string;
|
|
478
|
+
readonly dir: string | null;
|
|
479
|
+
readonly count: number;
|
|
480
|
+
readonly bytes: number;
|
|
481
|
+
/** The first material keys of the group (up to 20). */
|
|
482
|
+
readonly keys: readonly string[];
|
|
483
|
+
/** DA: what it holds that nothing carries; absent when it holds nothing, and on checks recorded before DA. */
|
|
484
|
+
readonly holds?: GroupHolds;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** A round's coverage check (D99; Spec §3.3 每份材料都有交代): what it found untouched, and what is accounted for. */
|
|
488
|
+
export interface RoundCoverage {
|
|
489
|
+
readonly at: string;
|
|
490
|
+
readonly accounted: readonly MaterialAccount[];
|
|
491
|
+
/** Every listed material is read, accounted for, or in a follow-up lane that has ended. */
|
|
492
|
+
readonly settled: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* What the last check (`at`) listed as touched by no lane, as `pk_coverage_check` returned it: the Keeper view shows it
|
|
495
|
+
* (Spec §6.9: 覆盖检查列出的材料与主 agent 的交代点得开). Absent when the check did not record its listing.
|
|
496
|
+
*/
|
|
497
|
+
readonly untouched?: readonly CoverageGroup[] | null;
|
|
498
|
+
}
|
|
499
|
+
export type RoundKind = 'First usable' | 'Deepen' | 'Follow up';
|
|
500
|
+
|
|
501
|
+
/** Where the time of one step or path went (§3.10): the four parts D81 asks for, plus what cannot be told apart. */
|
|
502
|
+
export interface StepTiming {
|
|
503
|
+
readonly wallMs: number;
|
|
504
|
+
readonly generationMs: number;
|
|
505
|
+
readonly toolMs: number;
|
|
506
|
+
readonly queueMs: number;
|
|
507
|
+
readonly parseRetryMs: number;
|
|
508
|
+
readonly otherMs: number;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export type RoundDocKind = 'History map' | 'Questions' | 'Brief' | 'Report' | 'Adoption' | 'Handover' | 'Spot check' | 'Layers' | 'Result';
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* A document a round leaves behind (§3.3 "留痕点得开"): the history map and question list from orientation, each deep
|
|
515
|
+
* sweep's brief and full report, the cross-check's adoption record, the main agent's handover to the synthesis (D103),
|
|
516
|
+
* the spot check. Full text, never shortened.
|
|
517
|
+
*/
|
|
518
|
+
export interface RoundDoc {
|
|
519
|
+
readonly id: string;
|
|
520
|
+
readonly projectId: string;
|
|
521
|
+
readonly roundId: string;
|
|
522
|
+
readonly jobId: string | null;
|
|
523
|
+
readonly kind: RoundDocKind;
|
|
524
|
+
/** The deep sweep's name, for briefs and reports. */
|
|
525
|
+
readonly path: string | null;
|
|
526
|
+
readonly title: string;
|
|
527
|
+
readonly markdown: string;
|
|
528
|
+
readonly at: string;
|
|
529
|
+
/**
|
|
530
|
+
* A report written by one reading assignment of the sweep (§3.3, §3.7): the assignment's id in the round's reading
|
|
531
|
+
* record. The sweep's reports are then one per assignment, together the path's report.
|
|
532
|
+
*/
|
|
533
|
+
readonly assignment?: string | null;
|
|
534
|
+
/**
|
|
535
|
+
* What the assignment says it could not read in full, each material on its list by its key, whether it read part of it
|
|
536
|
+
* or none, and why — the program holds this against what the assignment's recorded reads show.
|
|
537
|
+
*/
|
|
538
|
+
readonly unread?: readonly { readonly material: string; readonly read: 'part' | 'none'; readonly why: string }[];
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// ───────────────────────── §3.3, §3.7 a deepening's reading assignments ─────────────────────────
|
|
542
|
+
|
|
543
|
+
/** The units a Full deepening plans (§3.7: 按问题清单算), and the one a path counted by the ledger's totals adds: sessions. */
|
|
544
|
+
export type ReadingCategory = 'document versions' | 'code files' | 'commits' | 'sessions';
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* One material a path of a Full deepening plans to read (§3.7), as the program placed it when the sweeps started: what it
|
|
548
|
+
* is, what it is kept with, how much there is to read, how it is read, and where it is — what the program holds the
|
|
549
|
+
* assignment's recorded reads against.
|
|
550
|
+
*/
|
|
551
|
+
export interface ReadingMaterial {
|
|
552
|
+
/** `doc:<path>@<commit>` (a document version), `<repo>:<path>` (a code file), `commit:<hash>`, `session:<id>` (the ledger's ids). */
|
|
553
|
+
readonly key: string;
|
|
554
|
+
readonly category: ReadingCategory;
|
|
555
|
+
readonly label: string;
|
|
556
|
+
/** What it stays with in an assignment: a document's versions, a directory's files, a merge's commits, a session. */
|
|
557
|
+
readonly group: string;
|
|
558
|
+
/** About how much text there is to read, in bytes: what the assignments are sized by. */
|
|
559
|
+
readonly bytes: number;
|
|
560
|
+
/** How it is read, in the words its assignment gives the step. */
|
|
561
|
+
readonly how: string;
|
|
562
|
+
/** A document version or a code file: the file, absolute. */
|
|
563
|
+
readonly file?: string | null;
|
|
564
|
+
/** A document version: the commit it is at. */
|
|
565
|
+
readonly rev?: string | null;
|
|
566
|
+
/** A document version that stands for the file as it is now: reading the file reads it. */
|
|
567
|
+
readonly current?: boolean;
|
|
568
|
+
readonly lines?: number | null;
|
|
569
|
+
/**
|
|
570
|
+
* An older version of a document read through what it changed: the version after it (its key), and this version's own
|
|
571
|
+
* lines that differ from that one (1-based, inclusive). The rest of its text is that version's.
|
|
572
|
+
*/
|
|
573
|
+
readonly next?: string | null;
|
|
574
|
+
readonly diff?: readonly (readonly [number, number])[] | null;
|
|
575
|
+
/** A session: its ledger id and how many messages the ledger holds of it. */
|
|
576
|
+
readonly session?: string | null;
|
|
577
|
+
readonly messages?: number | null;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** One reading assignment: a deep-sweep job with its own list of the path's materials (§3.3 step 3, §3.7). */
|
|
581
|
+
export interface ReadingAssignment {
|
|
582
|
+
readonly id: string;
|
|
583
|
+
/** Its number within the path, from 1. */
|
|
584
|
+
readonly n: number;
|
|
585
|
+
readonly jobId: string | null;
|
|
586
|
+
readonly keys: readonly string[];
|
|
587
|
+
/**
|
|
588
|
+
* A material too large for one assignment is read in parts: the lines (a session's: message positions) this assignment
|
|
589
|
+
* reads of it, by its key. The material counts as read whole once its parts together are.
|
|
590
|
+
*/
|
|
591
|
+
readonly ranges?: Readonly<Record<string, readonly [number, number]>>;
|
|
592
|
+
/** The path's earlier assignments whose unread material it takes up; empty for a first assignment. */
|
|
593
|
+
readonly followUpOf: readonly number[];
|
|
594
|
+
readonly bytes: number;
|
|
595
|
+
readonly at: string;
|
|
596
|
+
/** When the program held what it read against its list, once it ended; null until then. */
|
|
597
|
+
readonly handledAt?: string | null;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/** A planned material the round records as read in part, or not read, with why and who said it. */
|
|
601
|
+
export interface ReadingAccount {
|
|
602
|
+
readonly key: string;
|
|
603
|
+
readonly outcome: 'part' | 'none';
|
|
604
|
+
readonly why: string;
|
|
605
|
+
readonly by: 'assignment' | 'program';
|
|
606
|
+
readonly at: string;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/** One path of the deepening: its planned materials, its assignments, and what is accounted for. */
|
|
610
|
+
export interface RoundReadingPath {
|
|
611
|
+
readonly path: string;
|
|
612
|
+
/** How the plan counted the path (what its brief names, or the ledger's totals for its kind of question). */
|
|
613
|
+
readonly basis: string;
|
|
614
|
+
readonly materials: readonly ReadingMaterial[];
|
|
615
|
+
readonly assignments: readonly ReadingAssignment[];
|
|
616
|
+
readonly accounted: readonly ReadingAccount[];
|
|
617
|
+
/** Every planned material is read whole, or recorded read in part or not read with why, and no assignment runs. */
|
|
618
|
+
readonly complete: boolean;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* A Full deepening's reading (Spec §3.3, §3.7; the owner's approval of 2026-09-28: 「好的,需要的。」): each path's planned
|
|
623
|
+
* material split into reading assignments on the lanes; the round's cross-check starts only once every planned material
|
|
624
|
+
* is accounted for.
|
|
625
|
+
*/
|
|
626
|
+
export interface RoundReading {
|
|
627
|
+
readonly at: string;
|
|
628
|
+
/** What an assignment is sized to, and why. */
|
|
629
|
+
readonly budget: { readonly bytes: number; readonly basis: string };
|
|
630
|
+
readonly paths: readonly RoundReadingPath[];
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export interface SpotCheck {
|
|
634
|
+
readonly sampled: number;
|
|
635
|
+
readonly wrong: number;
|
|
636
|
+
readonly byKind: Readonly<Record<string, number>>;
|
|
637
|
+
readonly corrected: number;
|
|
638
|
+
/** What was checked, so a check repeated in another session is not counted twice. */
|
|
639
|
+
readonly targets?: readonly { readonly collection: string; readonly id: string; readonly kind: string; readonly wrong: boolean; readonly corrected: boolean; readonly wrongKind?: SpotWrongKind | null }[];
|
|
640
|
+
/**
|
|
641
|
+
* D103: the synthesis' outputs — every note it wrote or changed, every six-things judgement it made, the round's
|
|
642
|
+
* Result — are checked in full, not sampled, and counted apart from the sample: how many there are, how many of them
|
|
643
|
+
* the spot-check recorded, and how many it found wrong. Absent on a round with no synthesis job.
|
|
644
|
+
*/
|
|
645
|
+
readonly synthesis?: { readonly outputs: number; readonly checked: number; readonly wrong: number };
|
|
646
|
+
/** CM: of the wrong ones, how many were wrong only because of when the state was read (a candidate recomputed later, a link confirmed after) and how many in substance. */
|
|
647
|
+
readonly wrongByKind?: { readonly timing: number; readonly substance: number };
|
|
648
|
+
/**
|
|
649
|
+
* CS (D104): the placement readings, counted apart — the reasons that left an item unplaced (`noPlanWhy`, `noAreaWhy`,
|
|
650
|
+
* `wholeProductWhy`), whichever round wrote them, that this spot-check was given, how many of them it recorded and how
|
|
651
|
+
* many it found wrong; and of the program's Inferred placements nobody had reviewed, how many it sampled and found wrong.
|
|
652
|
+
*/
|
|
653
|
+
readonly placement?: SpotCheckPlacement;
|
|
654
|
+
/**
|
|
655
|
+
* CS: each reason this spot-check recorded, with the reason's words as it checked them and the outcome. A reason found
|
|
656
|
+
* right and unchanged since is not a target of a later round's spot-check; one that changed, or one found wrong and
|
|
657
|
+
* still standing, is a target again (process/breakpoint-candidates.ts `uncheckedReasons`).
|
|
658
|
+
*/
|
|
659
|
+
readonly reasonChecks?: readonly ReasonCheck[];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/** CS: the spot-check's count of the placement readings (Spec §3.3; CKC-23 AC-9). */
|
|
663
|
+
export interface SpotCheckPlacement {
|
|
664
|
+
readonly reasons: number;
|
|
665
|
+
readonly reasonsChecked: number;
|
|
666
|
+
readonly reasonsWrong: number;
|
|
667
|
+
readonly programPlacementsSampled: number;
|
|
668
|
+
readonly programPlacementsWrong: number;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/** CS: one reason that leaves an item unplaced — which item, which reason, and its words. */
|
|
672
|
+
export interface ReasonTarget {
|
|
673
|
+
readonly collection: 'threads' | 'reference';
|
|
674
|
+
readonly id: string;
|
|
675
|
+
readonly field: 'noPlanWhy' | 'noAreaWhy' | 'wholeProductWhy';
|
|
676
|
+
readonly reason: string;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/** CS: a reason a spot-check recorded: its words as checked, and the outcome. */
|
|
680
|
+
export interface ReasonCheck extends ReasonTarget {
|
|
681
|
+
readonly wrong: boolean;
|
|
682
|
+
readonly at: string;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* CS: what a round's spot-check was given of the placement readings, fixed as it started, so its own corrections (a
|
|
687
|
+
* reason cleared with a placement, a program placement moved) take nothing away from what it is counted against.
|
|
688
|
+
*/
|
|
689
|
+
export interface PlacementCheckPlan {
|
|
690
|
+
readonly at: string;
|
|
691
|
+
readonly reasons: readonly ReasonTarget[];
|
|
692
|
+
/** The program's unreviewed placements in the sample, each by the item and the Area or Plan it was placed on. */
|
|
693
|
+
readonly placements: readonly { readonly kind: InferredPlacement['kind']; readonly id: string; readonly targetId: string }[];
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/** CM: a wrong the spot-check found is a state-timing wrong (right when written, overtaken by a later write or recompute) or a wrong of substance. */
|
|
697
|
+
export type SpotWrongKind = 'timing' | 'substance';
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* One round of the clerk method (§3.3, §3.10): the takeover's first usable round, a deepening round, or a Follow up. Its
|
|
701
|
+
* steps are jobs under `rootJobId`; what it produced is counted by the program from what its steps wrote (CKC-23 AC-6).
|
|
702
|
+
* A Follow up round also has the Follow up round record the propagation judgements hang on (`followUpRoundId`).
|
|
703
|
+
*/
|
|
704
|
+
export interface ClerkRound {
|
|
705
|
+
readonly id: string;
|
|
706
|
+
readonly projectId: string;
|
|
707
|
+
readonly kind: RoundKind;
|
|
708
|
+
readonly number: number;
|
|
709
|
+
readonly startedAt: string;
|
|
710
|
+
readonly endedAt: string | null;
|
|
711
|
+
readonly status: 'Running' | 'Done' | 'Stopped' | 'Failed';
|
|
712
|
+
readonly rootJobId: string;
|
|
713
|
+
/** Orientation's question list for the deepening (a `RoundDoc`), and the deep sweeps it set. */
|
|
714
|
+
readonly questionsDocId: string | null;
|
|
715
|
+
readonly paths: readonly string[];
|
|
716
|
+
readonly outputs: readonly { readonly position: string; readonly count: number }[];
|
|
717
|
+
readonly groundwork: readonly { readonly kind: string; readonly count: number }[];
|
|
718
|
+
readonly unplaced: { readonly count: number; readonly reasons: readonly string[] };
|
|
719
|
+
readonly spotCheck: SpotCheck | null;
|
|
720
|
+
readonly ledger: { readonly ms: number; readonly commitsAdded: number } | null;
|
|
721
|
+
readonly followUpRoundId: string | null;
|
|
722
|
+
/** A deepening: the depth it ran at, recorded when it started (D105: the page says what ran, not what was pressed last). */
|
|
723
|
+
readonly depth?: TakeoverDepth | null;
|
|
724
|
+
/** A Follow up: what started it — the owner's `Follow up`, a scheduled time, or the `Continuous` schedule (§3.8; the `Daily` page says which). */
|
|
725
|
+
readonly startedBy?: 'owner' | 'schedule' | 'continuous' | null;
|
|
726
|
+
/** What the round's end did with the project's `projectkeeper/` folder, or why it could not (CKC-26 AC-8); null when not authorized. */
|
|
727
|
+
readonly folder?: string | null;
|
|
728
|
+
/**
|
|
729
|
+
* The sweeps the program added to a takeover's deepening for the kinds of question orientation set no sweep for, each
|
|
730
|
+
* with why (CKC-23 AC-4: at least the four kinds of Spec §3.3); their briefs are round documents of this round.
|
|
731
|
+
*/
|
|
732
|
+
readonly sweepsAdded?: readonly { readonly path: string; readonly why: string }[];
|
|
733
|
+
/** A Follow up round: the state of its news positions when it started, to tell what it made new (§3.8); dropped when it closes. */
|
|
734
|
+
readonly baseline?: RoundBaseline | null;
|
|
735
|
+
/** A Full deepening: its sweeps' reading assignments and what is accounted for (§3.3, §3.7); absent on other rounds. */
|
|
736
|
+
readonly reading?: RoundReading | null;
|
|
737
|
+
/** D99: the stage the main agent is in, and the stages it went through; absent on rounds before D99. */
|
|
738
|
+
readonly stage?: ClerkStage | null;
|
|
739
|
+
readonly stageLog?: readonly StageEntry[];
|
|
740
|
+
/**
|
|
741
|
+
* D103: the main agent handed the round over to the synthesis after its last stage — when, and its `Handover` round
|
|
742
|
+
* document (what it settled, what it left open and why, what the synthesis should look at first). Its stage log ends
|
|
743
|
+
* there; the synthesis is a job of its own. Absent until then, and on rounds before D103.
|
|
744
|
+
*/
|
|
745
|
+
readonly handover?: { readonly at: string; readonly docId: string; /** Why it handed over with a gate left open (`pk_stage` why). */ readonly why?: string | null } | null;
|
|
746
|
+
/**
|
|
747
|
+
* D103 (CKC-08 AC-25): what a deepening or a Follow up did with the notes that were current when it began — how many
|
|
748
|
+
* there were, how many its synthesis confirmed as still holding, updated or withdrew, and how many got no result —
|
|
749
|
+
* counted by the program as the round closes (keeper/organize/standing-notes.ts). Absent on a first usable round.
|
|
750
|
+
*/
|
|
751
|
+
readonly standingNotes?: { readonly standing: number; readonly confirmed: number; readonly updated: number; readonly withdrawn: number; readonly open: number } | null;
|
|
752
|
+
/** D99: the lanes the main agent sent, in the order sent. */
|
|
753
|
+
readonly lanes?: readonly RoundLane[];
|
|
754
|
+
/**
|
|
755
|
+
* DB: the workbench slots no lane of a first usable round's skeleton held, each with the main agent's one line on why
|
|
756
|
+
* the project has nothing for it (`pk_send_lanes` `empty`; keeper/organize/slots.ts). The next spot-check is shown
|
|
757
|
+
* them. Absent when every slot was held by a lane.
|
|
758
|
+
*/
|
|
759
|
+
readonly emptySlots?: readonly EmptySlot[];
|
|
760
|
+
/** D99: the coverage check of a deepening; null until the main agent enters it. */
|
|
761
|
+
readonly coverage?: RoundCoverage | null;
|
|
762
|
+
/**
|
|
763
|
+
* What did not finish (Spec §3.10: 多次失败后停下,列入失败清单并写明原因,不静默跳过): each job of a step that still failed
|
|
764
|
+
* after the program ran it again, or that its time limit stopped. The round went on without it, and it closes `Done`
|
|
765
|
+
* with these listed; absent or empty when every step finished.
|
|
766
|
+
*/
|
|
767
|
+
readonly failures?: readonly RoundFailure[];
|
|
768
|
+
/**
|
|
769
|
+
* CJ: the numbers of a current decision record, plan, task index or execution arrangement the main agent accounted for
|
|
770
|
+
* by number, with why, instead of making them items (`pk_account_entries`); absent when it accounted for none.
|
|
771
|
+
*/
|
|
772
|
+
readonly entryAccounts?: readonly EntryAccount[];
|
|
773
|
+
/** CM: the candidate generations the main agent accepted or rejected (pk_generation_candidate), so a rejected one is not listed again. */
|
|
774
|
+
readonly generationVerdicts?: readonly GenerationVerdict[];
|
|
775
|
+
/**
|
|
776
|
+
* DA: the owner's lines judged in this round to need nothing — for their moment only — each by its line reference,
|
|
777
|
+
* with why (`pk_judge_owner_lines`). A line judged once is not listed again in a later round while its words stand; the
|
|
778
|
+
* round's spot-check samples them.
|
|
779
|
+
*/
|
|
780
|
+
readonly ownerLineJudgements?: readonly OwnerLineJudgement[];
|
|
781
|
+
/**
|
|
782
|
+
* CQ (D104): the placements the program wrote itself in this round, basis Inferred, each with the chain of records it
|
|
783
|
+
* followed (keeper/organize/placement-inference.ts), and what the main agent or a lane did with it since. CS: one with
|
|
784
|
+
* no result stays listed in every later round (`pk_round_state` `inferredPlacements` covers every round's) until a
|
|
785
|
+
* write confirms or moves it — the result lands here, on the record of the round that placed it; the spot-check samples
|
|
786
|
+
* the ones with no result.
|
|
787
|
+
*/
|
|
788
|
+
readonly inferredPlacements?: readonly InferredPlacement[];
|
|
789
|
+
/** CS: what this round's spot-check was given of the placement readings, fixed as it started; absent before, and on a round with no spot-check. */
|
|
790
|
+
readonly placementCheck?: PlacementCheckPlan | null;
|
|
791
|
+
readonly updatedAt: string;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/** CQ (D104): one placement the program wrote from the records, and its fate. */
|
|
795
|
+
export interface InferredPlacement {
|
|
796
|
+
/** The item placed: a work item (`thread`) or a decision or boundary (`reference`). */
|
|
797
|
+
readonly kind: 'thread' | 'reference';
|
|
798
|
+
readonly id: string;
|
|
799
|
+
readonly name: string;
|
|
800
|
+
/** The Area or Plan it was placed on, by id, and by its short name. */
|
|
801
|
+
readonly targetId: string;
|
|
802
|
+
readonly target: string;
|
|
803
|
+
readonly targetCategory: 'Area' | 'Plan';
|
|
804
|
+
/** The chain of records the program followed, in one sentence; the `serves` claim carries the same words. */
|
|
805
|
+
readonly chain: string;
|
|
806
|
+
readonly at: string;
|
|
807
|
+
/** The stage the program placed it in: entering reconcile, entering the cross-check, or at the handover. */
|
|
808
|
+
readonly stage: string;
|
|
809
|
+
readonly jobId: string | null;
|
|
810
|
+
/**
|
|
811
|
+
* What became of it since: a model's write kept it as its own, or the spot-check checked it and found it right
|
|
812
|
+
* (`confirmed`); a write replaced or removed it (`moved`, with where to). Absent while nobody touched it: it stands as
|
|
813
|
+
* placed and stays listed. CS: `roundId` is the round the result was written in (a later one than the round that
|
|
814
|
+
* placed it, when it carried over), `by` who gave it — a model's write, the spot-check's record, or the program finding
|
|
815
|
+
* the placement no longer on the item.
|
|
816
|
+
*/
|
|
817
|
+
readonly result?: { readonly kind: 'confirmed' | 'moved'; readonly at: string; readonly to?: string; readonly roundId?: string | null; readonly by?: 'write' | 'spot-check' | 'program' } | null;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/** CM: the main agent's verdict on a candidate generation the program listed. */
|
|
821
|
+
export interface GenerationVerdict {
|
|
822
|
+
readonly key: string;
|
|
823
|
+
readonly accepted: boolean;
|
|
824
|
+
readonly why: string;
|
|
825
|
+
readonly generationId: string | null;
|
|
826
|
+
readonly at: string;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/** DA: an owner's line judged to need nothing (Spec §1.3, §3.11): the third outcome of a line, beside cited and not looked at yet. */
|
|
830
|
+
export interface OwnerLineJudgement {
|
|
831
|
+
/** The session draft the line is in, and the line's ref there. */
|
|
832
|
+
readonly draftId: string;
|
|
833
|
+
readonly ref: string;
|
|
834
|
+
/** How the line's words began when it was judged (folded): a line whose words changed since is looked at again. */
|
|
835
|
+
readonly head: string;
|
|
836
|
+
readonly why: string;
|
|
837
|
+
readonly by: 'main' | 'lane';
|
|
838
|
+
/** The lane's name, when a lane judged it. */
|
|
839
|
+
readonly lane?: string | null;
|
|
840
|
+
readonly jobId: string;
|
|
841
|
+
readonly at: string;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** Numbers of one document the main agent accounted for, each by its number (CJ; E150: an account in bulk is not one). */
|
|
845
|
+
export interface EntryAccount {
|
|
846
|
+
/** The document, repository-relative, as the gate names it. */
|
|
847
|
+
readonly path: string;
|
|
848
|
+
readonly numbers: readonly string[];
|
|
849
|
+
readonly why: string;
|
|
850
|
+
readonly at: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/** A job of a round's step that did not finish, as the round lists it (`ClerkRound.failures`). */
|
|
854
|
+
export interface RoundFailure {
|
|
855
|
+
readonly jobId: string;
|
|
856
|
+
readonly step: RoundStepKind;
|
|
857
|
+
/** The job's label (a sweep's name and assignment, a drafts batch). */
|
|
858
|
+
readonly label: string;
|
|
859
|
+
readonly status: 'Failed' | 'Stopped';
|
|
860
|
+
/** Why its last run ended. */
|
|
861
|
+
readonly reason: string;
|
|
862
|
+
/** How many times it ran: the first run and every run again. */
|
|
863
|
+
readonly runs: number;
|
|
864
|
+
/** When it was listed. */
|
|
865
|
+
readonly at: string;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Where the five kinds of Follow up news stood when a round started (Spec §3.8, §5.5; CKC-07 AC-27, CKC-24 AC-15): the
|
|
870
|
+
* breakpoints lit, each send-back's stage, each six-thing tag, the semantic patches confirmed, each note's version count.
|
|
871
|
+
* What the round's jobs wrote is compared with it when the round closes.
|
|
872
|
+
*/
|
|
873
|
+
export interface RoundBaseline {
|
|
874
|
+
readonly litBreakpoints: readonly string[];
|
|
875
|
+
readonly sendbackStages: Readonly<Record<string, SendBackStage>>;
|
|
876
|
+
/** `<kind>:<id>` (a territory anomaly: `anomaly:<territory>:<kind>:<text>`) → the thing it was, for what was live. */
|
|
877
|
+
readonly sixThings: Readonly<Record<string, SixThing>>;
|
|
878
|
+
readonly confirmedPatches: readonly string[];
|
|
879
|
+
readonly noteVersions: Readonly<Record<string, number>>;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/** One new thing of a Follow up round, where it is (§3.8: "各带位置"). */
|
|
883
|
+
export interface RoundNewsItem {
|
|
884
|
+
/** The breakpoint, send-back, patch or note; for a six-thing item, the object tagged. */
|
|
885
|
+
readonly id: string;
|
|
886
|
+
/** What it is, in one line: "Findings open on T-1 Hand picking". */
|
|
887
|
+
readonly label: string;
|
|
888
|
+
/** Where on the workbench it is: the view and the object, e.g. "Process view · T-1 Hand picking". */
|
|
889
|
+
readonly position: string;
|
|
890
|
+
/** The object it hangs on, to locate it (graph node, work item, reference item, territory); null when none. */
|
|
891
|
+
readonly objectId: string | null;
|
|
892
|
+
/** What changed for it this round: "new · Suggested", "Suggested → Returned", "5 let pass", "v2". */
|
|
893
|
+
readonly detail: string | null;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* What a Follow up round made new (§3.8, D79; CKC-07 AC-27, CKC-24 AC-15), counted by the program from what the round's
|
|
898
|
+
* jobs wrote, compared with where things stood when it started. `nothingNew`: the five are empty and no object was left
|
|
899
|
+
* behind — the top bar says the last round found nothing new.
|
|
900
|
+
*/
|
|
901
|
+
export interface RoundNews {
|
|
902
|
+
readonly breakpoints: readonly RoundNewsItem[];
|
|
903
|
+
readonly sendbacks: readonly RoundNewsItem[];
|
|
904
|
+
readonly sixThings: readonly RoundNewsItem[];
|
|
905
|
+
readonly patches: readonly RoundNewsItem[];
|
|
906
|
+
readonly notes: readonly RoundNewsItem[];
|
|
907
|
+
readonly nothingNew: boolean;
|
|
908
|
+
/** One line a person reads: "2 breakpoints newly lit · 1 new send-back" or "Nothing new". */
|
|
909
|
+
readonly statement: string;
|
|
910
|
+
/** False when the round started before the baseline was kept: the send-backs moved, the six things and the patches of such a round are not counted. */
|
|
911
|
+
readonly complete: boolean;
|
|
912
|
+
}
|