clearotron 0.5.0 → 0.5.1-beta.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/CONTRIBUTING.md +2 -2
- package/INSTALL.md +334 -302
- package/QUICKSTART.md +12 -4
- package/README.md +12 -7
- package/THIRD-PARTY-NOTICES.md +4 -4
- package/bin/README.md +14 -11
- package/bin/clearotron.mjs +1 -1
- package/bin/connect.mjs +73 -25
- package/bin/example.mjs +4 -2
- package/bin/onboard.mjs +562 -336
- package/bin/start.mjs +184 -36
- package/bin/update.mjs +26 -13
- package/build-info.json +2 -2
- package/docs/PORTAL.md +2 -2
- package/docs/architecture/02-architecture.md +3 -3
- package/docs/architecture/04-configuration-reference.md +1 -2
- package/docs/architecture/05-config-governance.md +1 -1
- package/docs/architecture/06-operations-runbook.md +1 -1
- package/driver/CHANGELOG.md +77 -0
- package/driver/README.md +2 -2
- package/driver/config-inventory.mjs +20 -11
- package/driver/contract-e3-backlog.mjs +27 -27
- package/driver/contract-e3-baseline.json +2 -2
- package/driver/contract-vocabulary.mjs +1 -1
- package/driver/degraded-parts.mjs +67 -3
- package/driver/dev-portal.mjs +1 -1
- package/driver/digest-queue.mjs +5 -5
- package/driver/driver.config.mjs +9 -9
- package/driver/engine/CONTRACT.md +1 -1
- package/driver/engine/anthropic-agent.mjs +4 -2
- package/driver/engine/mcp/band-server.mjs +1 -21
- package/driver/engine/mcp/clarivate-propose-tool.mjs +26 -0
- package/driver/engine/mcp/clarivate-server.mjs +2 -18
- package/driver/engine/mcp/fixture-register-server.mjs +33 -0
- package/driver/engine/mcp/gather-config.mjs +48 -7
- package/driver/engine/mcp/recording-server.mjs +206 -14
- package/driver/engine/mcp/supplemental.mjs +4 -2
- package/driver/engine/openai-agent.mjs +3 -1
- package/driver/engine/probe.mjs +10 -0
- package/driver/filing-goods.mjs +95 -0
- package/driver/findings-model.mjs +3 -0
- package/driver/gateway.mjs +42 -40
- package/driver/knockout-assess-record.mjs +54 -4
- package/driver/knockout-correction-record.mjs +342 -0
- package/driver/knockout-frame-record.mjs +4 -2
- package/driver/knockout-register-read.mjs +705 -0
- package/driver/knockout-register-record.mjs +222 -0
- package/driver/knockout-review-record.mjs +96 -25
- package/driver/narrative-refutation-record.mjs +87 -1
- package/driver/order-tables.mjs +23 -0
- package/driver/owner-use-check.mjs +5 -2
- package/driver/package.json +1 -1
- package/driver/partial-payload-baseline.json +8 -0
- package/driver/pipeline-knockout.mjs +506 -313
- package/driver/pipeline.mjs +179 -86
- package/driver/portal-local-auth.mjs +7 -1
- package/driver/portal-service.mjs +62 -6
- package/driver/progress.mjs +2 -2
- package/driver/publish/index.mjs +18 -21
- package/driver/publish/knockout.mjs +40 -18
- package/driver/publish/render-knockout.mjs +40 -27
- package/driver/publish/report-dates.mjs +43 -0
- package/driver/recall-reconciliation.mjs +2 -2
- package/driver/record-goods.mjs +50 -9
- package/driver/register-count.mjs +12 -59
- package/driver/register-fixture-marker.mjs +22 -0
- package/driver/register-plan.mjs +48 -0
- package/driver/register-records.mjs +84 -266
- package/driver/register-taint.mjs +2 -2
- package/driver/repair-composers.mjs +15 -8
- package/driver/result-noun-fields.mjs +6 -2
- package/driver/run-requirements.mjs +54 -4
- package/driver/runner.mjs +4 -13
- package/driver/skills/clearance-register/providers/clarivate.md +2 -2
- package/driver/skills/knockout-assess/SKILL.md +101 -100
- package/driver/skills/knockout-frame/SKILL.md +3 -1
- package/driver/skills/knockout-register-read/SKILL.md +77 -0
- package/driver/stages-knockout.mjs +159 -98
- package/driver/stages.mjs +4 -2
- package/driver/suite-census.json +389 -71
- package/driver/systemd/README.md +2 -2
- package/driver/verify-knockout.mjs +175 -39
- package/driver/verify.mjs +10 -9
- package/mcp-server/CHANGELOG.md +4 -0
- package/mcp-server/CONNECT.md +4 -0
- package/mcp-server/demo-mode.mjs +6 -0
- package/mcp-server/lib/demo-texts.mjs +38 -0
- package/mcp-server/lib/http-handler.mjs +7 -1
- package/mcp-server/lib/knockout.mjs +3 -2
- package/mcp-server/lib/options.mjs +3 -1
- package/mcp-server/lib/plan.mjs +6 -1
- package/mcp-server/mint-token.mjs +1 -1
- package/mcp-server/package.json +1 -1
- package/mcp-server/serve.mjs +11 -0
- package/mcp-server/server.mjs +13 -5
- package/package.json +1 -1
- package/portal-ui/dist/assets/{index-D2wrw9cH.css → index-AtB9ZpDH.css} +29 -0
- package/portal-ui/dist/assets/{index-DcLbvFmQ.js → index-C1oE78Wk.js} +161 -195
- package/portal-ui/dist/index.html +2 -2
- package/portal-ui/package.json +4 -4
- package/providers/README.md +4 -4
- package/providers/_shared/execute-plan.mjs +45 -1
- package/providers/_shared/term-shape.mjs +1 -1
- package/providers/clarivate/src/capabilities.js +7 -6
- package/providers/clarivate/src/core.js +11 -7
- package/providers/clarivate/src/wider-list.js +104 -0
- package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
- package/providers/oauth-mcp-bridge/package.json +1 -1
- package/providers/signa/src/capabilities.js +0 -9
- package/scripts/e2e-first-time.mjs +8 -7
- package/scripts/freeze-example-run.mjs +2 -2
- package/scripts/settings-render-check.mjs +5 -3
- package/scripts/test-run.mjs +8 -2
- package/shared/client-door.mjs +11 -8
- package/shared/connect-clients.mjs +10 -4
- package/shared/demo-connection.mjs +43 -0
- package/shared/demo-start-args.mjs +7 -2
- package/shared/invocation.mjs +18 -3
- package/shared/permanent-install.mjs +14 -0
- package/shared/scope.mjs +8 -1
- package/shared/stdio-connect.mjs +43 -21
- package/shared/trigger-lane.mjs +7 -0
- package/shared/tty-style.mjs +21 -5
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knockout-register-read
|
|
3
|
+
description: Read the register for a KNOCKOUT batch. Look at each name's counts, ask what the reading rule calls for, read each list you select in full, and hand back what you carry forward, what you set aside and why. You rate nothing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reading the register for a knockout batch
|
|
7
|
+
|
|
8
|
+
A knockout is a clearance with less effort and depth, and it reads the register by the clearance's rule. You work name
|
|
9
|
+
by name and you rate nothing. The step after you rates what you carry forward, with your reasons, and it can still reach
|
|
10
|
+
everything you set aside. Questions ask for filings of any status; you weigh status when you read.
|
|
11
|
+
|
|
12
|
+
### At every step: look at what you have before you work on it
|
|
13
|
+
|
|
14
|
+
Fifty? Read them all. A few hundred? Sort by the client's goods and markets, read the near ones first, list
|
|
15
|
+
the rest. A thousand or more? The field is crowded: read the identical and live ones for the client's
|
|
16
|
+
goods, tell the client it is crowded, and do not write up the rest. Carry forward only what a lawyer would
|
|
17
|
+
raise with the client. Write down what you set aside and why. This applies to the register's answer, to the
|
|
18
|
+
list of records, to the placements, to the off-register sweep and to the write-up alike.
|
|
19
|
+
|
|
20
|
+
### Read the identical mark first. Look at the count before you read anything
|
|
21
|
+
|
|
22
|
+
On every matter the identical mark, in the instructed classes, is the first thing you read, and nothing
|
|
23
|
+
wider is asked until you have read it. The register tells you how many filings answer a question before it
|
|
24
|
+
hands you any. Take a look: how bad is it? If the list is one you can read record by record, read it in
|
|
25
|
+
full. If it is not, do not read it and do not leave it: narrow the same question, in this order, until it
|
|
26
|
+
is, then read that list in full and decide. Each step keeps the limits of the steps before it. Stop at the first
|
|
27
|
+
step that gives you a list you can read.
|
|
28
|
+
|
|
29
|
+
1. Ask again for the identical mark, in the instructed classes, limited to the client's goods. Choose the phrases and dominant goods terms that cover the requested goods, including their ordinary singular or plural forms where needed. Where the provider matches a multi-word goods term as an ordered phrase, include the dominant goods terms as alternatives in that same question; a phrase alone can miss a broader description of those goods. Use the provider's supported OR form. Read that list.
|
|
30
|
+
2. Still a crowd? Split the goods question by its dominant goods terms where that narrows it, then by each instructed class, keeping the earlier scope limits. Read each selected list. Reuse an answer already held for the same question and scope.
|
|
31
|
+
3. Still a crowd? Ask again one question per market, from the one list your opening message names. Read those
|
|
32
|
+
lists.
|
|
33
|
+
4. Still a crowd after step 3? The narrowing ends. Record it with its count: the field is crowded there.
|
|
34
|
+
|
|
35
|
+
A list you have read answers the crowd it came from. Do not ask that crowd again without the limits that answered
|
|
36
|
+
it.
|
|
37
|
+
|
|
38
|
+
A small list for a longer mark or narrower goods does not establish that a distinct root or sound-alike family adds nothing. Judge what that family could add to the advice and record the reason. Where no count is held, do not describe the family as a measured crowd.
|
|
39
|
+
|
|
40
|
+
The same steps serve any other question that comes back as a crowd, when reading it would change what you tell the client. Before you narrow a wider crowd, write in the proposal what reading it would change. If you cannot, set it aside with its count and your reason. You need not take every step on every crowd. A wider crowd that the lists you have read already
|
|
41
|
+
answer is set aside with its count and your reason. That is finished work, not a gap.
|
|
42
|
+
|
|
43
|
+
Once the identical mark for the client's goods has been read, decide as a lawyer would whether you have enough. Would more searching change what you tell the client: who could object, how weak the word is in this market, or what the client should do? If it would, widen one step, read, and decide again. If it would not, you are done. Write in one line why more searching would not change the advice, record which questions you did not ask and why, and move on. That is complete work.
|
|
44
|
+
|
|
45
|
+
Every question you ask is recorded with its count. A narrowing replaces nothing silently: the crowd it
|
|
46
|
+
replaces stays on the record with its count. What was counted and not read is set aside with that count,
|
|
47
|
+
never marked clean.
|
|
48
|
+
|
|
49
|
+
Base a decision that goods are unrelated on the held wording. If the short view is cut or its completeness is unknown, ask `read_register_list` with the filing's `record_id` for the full wording held. Missing or incomplete wording does not establish that the goods are unrelated; keep any unresolved goods question explicit.
|
|
50
|
+
|
|
51
|
+
### Near forms and wider questions
|
|
52
|
+
|
|
53
|
+
When the name's own list is read and more searching would change the advice, choose the next question from what you
|
|
54
|
+
read and from the client's request.
|
|
55
|
+
|
|
56
|
+
- **A near form** is a spelling someone could plausibly have filed for this name. Ask it as `exact`; several spellings
|
|
57
|
+
go as `terms` in one question. The mechanical near-spellings in your opening message came from a fixed table and were
|
|
58
|
+
counted, not read. Read them only if their count and the request justify it. If a justified sound-alike question fails or the register has no such mode, choose plausible spellings that could answer the unresolved point and ask them as `exact`, grouped in one supported `terms` question. Reuse answers already held for those spellings and scope. If no useful spelling can be proposed, record why rather than manufacture variants. An exact answer covers those spellings only; retain the failed or unsupported sound-alike question and explain any remaining uncertainty.
|
|
59
|
+
- **A word or phrase that carries the name** may justify a containing search, `default`. Not every word of every name
|
|
60
|
+
does.
|
|
61
|
+
- **A name your opening message lists in several written forms** is one item: each form has its own count and its own
|
|
62
|
+
question, on that name's axis. Never send a list as one term.
|
|
63
|
+
- **A sound-alike question**, `phonetic`, may answer a near-form question you have justified. Its filings come grouped
|
|
64
|
+
by office with no score, so neither their order nor their number says what is close, and some will not be close at
|
|
65
|
+
all. A register with no such search says so, and that is not a clean answer.
|
|
66
|
+
|
|
67
|
+
A verified zero answers that exact question. A failure leaves it unanswered; it does not prevent another justified question. A question that failed or was not sent is not a zero. A tool's note
|
|
68
|
+
beside a crowd may name `unit.md`; for you those are the steps above.
|
|
69
|
+
|
|
70
|
+
### What you hand back
|
|
71
|
+
|
|
72
|
+
One row per name. `carried`: the filings a lawyer would raise, in groups that share a reason. Mark a group `check_owner`
|
|
73
|
+
where what its owners actually sell would change how it reads; the driver then searches those owners before the rating
|
|
74
|
+
step. `set_aside`: per question,
|
|
75
|
+
what you read or counted and did not carry, and why; one reason covers a group, and no record needs a paragraph of its
|
|
76
|
+
own. `not_asked`: what you considered and did not ask, and why. `open_questions`: what you could not settle, for the step
|
|
77
|
+
that rates the name. If no filing is carried forward, keep `carried` empty. Still record the unread or unresolved questions and their reasons.
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { driverDir } from "../shared/driver-dir.mjs"; //
|
|
11
|
-
import { validators as koValidators } from "./verify-knockout.mjs";
|
|
11
|
+
import { validators as koValidators, registerLaneState, PERMITTED_SOURCES } from "./verify-knockout.mjs";
|
|
12
12
|
import { kebab, PRODUCT_POLICIES } from "./search-policy.mjs";
|
|
13
13
|
// — the door owns "did the request name any classes?"; this builder reads it rather than
|
|
14
14
|
// re-deriving it. A third copy is what put the knockout frame a class behind the intake.
|
|
15
15
|
import { requestNamesClasses } from "./enqueue-schema.mjs";
|
|
16
16
|
import { knockoutAssessChunkFile } from "./knockout-assess-record.mjs";
|
|
17
|
+
import { chunkScope, knockoutCorrectionFile, sameFinding, validateKnockoutCorrectionFile } from "./knockout-correction-record.mjs";
|
|
17
18
|
import { methodDictation, inputsShape } from "./framework-method.mjs";
|
|
18
19
|
import { knockoutReviewFile, validateKnockoutReviewFile } from "./knockout-review-record.mjs";
|
|
20
|
+
import { knockoutRegisterFile, validateKnockoutRegisterFile } from "./knockout-register-record.mjs";
|
|
21
|
+
import { narrowingOrderLine } from "./effective-scope.mjs";
|
|
19
22
|
export { kebab }; // one definition (search-policy) — re-exported for the lane's existing imports
|
|
20
23
|
|
|
21
24
|
const lines = (...xs) => xs.filter(Boolean).join("\n");
|
|
@@ -71,6 +74,10 @@ export function koPaths(runDir) {
|
|
|
71
74
|
// rows were left exactly as they were rather than gaining a matching marker: their shape is pinned
|
|
72
75
|
// byte-for-byte by register-count.test.mjs, and a discriminator only one side needs is enough.
|
|
73
76
|
registerRecords: driverDir(runDir, "register-records.json"),
|
|
77
|
+
// THE READING STEP'S RECORD, a model output and so at the run root: what it carried forward, set aside and did not
|
|
78
|
+
// ask. The questions and their rows are the register tool's, in the bands under `register-units/`.
|
|
79
|
+
registerReading: knockoutRegisterFile(runDir),
|
|
80
|
+
inboundRequest: join(runDir, "inbound-request.txt"),
|
|
74
81
|
// The scoped owner lookups this run owes its promoted filings, and their receipts. Both under `_driver/` because both are the DRIVER's own measurement of a call it made — the
|
|
75
82
|
// rule stated fourteen lines above. The seat reads the payloads under research/, never these.
|
|
76
83
|
ownerChecks: driverDir(runDir, "owner-checks.json"),
|
|
@@ -109,6 +116,9 @@ export function koPaths(runDir) {
|
|
|
109
116
|
// back to this and nothing ever writes it again. Delete once no resumable run predates the move.
|
|
110
117
|
assessChunkLegacy: (n) => driverDir(runDir, `knockout-assess-${n}.json`),
|
|
111
118
|
instructedScope: driverDir(runDir, "instructed-scope.json"),
|
|
119
|
+
// The client's own words, written at intake as on the clearance lane (stages.mjs, the same two names).
|
|
120
|
+
inboundRequest: join(runDir, "inbound-request.txt"),
|
|
121
|
+
confirmationBrief: join(runDir, "confirmation-brief.md"),
|
|
112
122
|
// as on the clearance lane, and apart from instructed-scope.json for the same reason: the frame
|
|
113
123
|
// quotes that file's values verbatim. Written at intake, read by no stage.
|
|
114
124
|
defaultTerritories: driverDir(runDir, "default-territories.json"),
|
|
@@ -172,6 +182,25 @@ export function knockoutBarVerdict({ startedAt = null, deliveredAt = null } = {}
|
|
|
172
182
|
return { runMinutes, overBar: runMinutes > KNOCKOUT_MINUTES_BAR };
|
|
173
183
|
}
|
|
174
184
|
|
|
185
|
+
/** The line a stage is told about the client's own request: the message as it came where it is on file, else the brief, which is never called the request, else nothing. */
|
|
186
|
+
/** The lines that say what this run's files establish about its register, where it holds no record of filings to weigh. */
|
|
187
|
+
function registerStateLine(K) {
|
|
188
|
+
const lane = registerLaneState(K.runDir);
|
|
189
|
+
if (lane.state === "skipped") return `The register component was skipped on this run, so it holds no filings.`;
|
|
190
|
+
if (lane.state === "unavailable") return `The register listing was unavailable on this run. Use the recorded counts and failure reason, and keep that gap explicit. The recorded counts: ${K.registerCounts}.${lane.reason ? ` The recorded reason: ${lane.reason}` : ""}`;
|
|
191
|
+
if (lane.state === "unknown") return `The held files do not establish whether the register component ran. Keep that uncertainty explicit.`;
|
|
192
|
+
return "";
|
|
193
|
+
}
|
|
194
|
+
const registerRecordHeld = (K) => registerLaneState(K.runDir).state === "held";
|
|
195
|
+
|
|
196
|
+
// WHERE A SOURCE MAY COME FROM, in one form of words at every step: rating, correction and check.
|
|
197
|
+
const CITED_URL_RULE = `A cited URL must come from ${PERMITTED_SOURCES}.`;
|
|
198
|
+
const SIBLING_SOURCE = `When you use another name's research payload, explain how its held content bears on this name and its requested use. Keep the original search scope and provenance. A source's presence in the batch does not establish that it supports the claim.`;
|
|
199
|
+
const OWNER_SOURCE = `A recorded owner check linked to a held filing is held evidence. You may cite a URL in its saved answer when it supports the finding; preserve the owner and filing it belongs to.`;
|
|
200
|
+
|
|
201
|
+
const requestLine = (K, onRequest, onBrief) => (existsSync(K.inboundRequest) ? onRequest(K.inboundRequest)
|
|
202
|
+
: existsSync(K.confirmationBrief) ? onBrief(K.confirmationBrief) : "");
|
|
203
|
+
|
|
175
204
|
/** The territories the request ordered, as the job carries them; empty for a worldwide screen. PURE. */
|
|
176
205
|
export const orderedTerritories = (job) =>
|
|
177
206
|
(Array.isArray(job?.jurisdictions) ? job.jurisdictions.map((s) => String(s).trim()).filter(Boolean) : []);
|
|
@@ -259,6 +288,12 @@ export const KO_STAGES = {
|
|
|
259
288
|
// was sold under. That is a rendering concession for old artifacts, not live vocabulary.
|
|
260
289
|
`You are framing a KNOCKOUT SEARCH batch — a triage pass. You frame, you do NOT search.`,
|
|
261
290
|
`The instructed scope (AUTHORITATIVE — quote mark names verbatim from it): ${K.instructedScope}`,
|
|
291
|
+
// THE REQUEST LEADS. The structured brief can hold no goods at all while the client's message states them: on a
|
|
292
|
+
// saved eight-name batch, 2026-10-28, the goods field was empty, neither this stage nor the rating read the message,
|
|
293
|
+
// and uses guessed from the customer's profile steered the ratings.
|
|
294
|
+
requestLine(K,
|
|
295
|
+
(at) => `The VERBATIM inbound request is archived at ${at}. Read it before you frame: it leads on the goods, services and intended use, and the customer's profile only fills what it leaves open.`,
|
|
296
|
+
(at) => `The archived original request is not available here. Read the available brief at ${at} before you frame. Use its stated scope and keep inferred uses explicit; the customer's profile fills gaps.`),
|
|
262
297
|
job.goods ? `Goods/services (verbatim): ${job.goods}` : "",
|
|
263
298
|
job.customer ? `Applicant (context only — never searched): ${job.customer}` : "",
|
|
264
299
|
profile?.industry ? `Customer industry (context for marketplace selection): ${profile.industry}.` : "",
|
|
@@ -290,8 +325,35 @@ export const KO_STAGES = {
|
|
|
290
325
|
`IF YOU CALL AGAIN, SEND ONLY WHAT YOU ARE CORRECTING. The driver merges marks BY NAME onto what it already accepted, so a mark you omit keeps its row — but a mark you DO send replaces that row whole, so send a corrected mark complete rather than as a fragment.`,
|
|
291
326
|
),
|
|
292
327
|
},
|
|
293
|
-
"knockout-
|
|
328
|
+
"knockout-register-read": {
|
|
294
329
|
model: "opus", thinking: "high", timeoutSec: 900, stallSec: 600,
|
|
330
|
+
// DECLARATIVE ONLY on this lane, as the assess stage records; the effective read is in the message.
|
|
331
|
+
skillReads: ["skills/knockout-register-read/SKILL.md"],
|
|
332
|
+
out: (K) => K.registerReading,
|
|
333
|
+
validate: validateKnockoutRegisterFile,
|
|
334
|
+
message: ({ K, job = {}, profile = null, readingLines = [], providerDoc = null, inScope = null }) => lines(
|
|
335
|
+
reads(["skills/knockout-register-read/SKILL.md", providerDoc].filter(Boolean)),
|
|
336
|
+
`You are reading the register for a KNOCKOUT batch, name by name. You rate nothing; the step after you rates what you carry forward, with your reasons.`,
|
|
337
|
+
existsSync(K.inboundRequest) ? `The client's request, as it arrived: ${K.inboundRequest}` : "",
|
|
338
|
+
job.goods ? `Goods/services (verbatim): ${job.goods}` : "",
|
|
339
|
+
job.upfrontInstructions ? `Requester instructions (verbatim): ${job.upfrontInstructions}` : "",
|
|
340
|
+
`The instructed scope: ${K.instructedScope}`,
|
|
341
|
+
`The batch plan, with what each name is for: ${K.plan}`,
|
|
342
|
+
narrowingOrderLine(job, profile, inScope),
|
|
343
|
+
`WHAT THE REGISTER HAS ANSWERED SO FAR, name by name. These are counts. For the identical question, decide whether to read the full answer or narrow it by the reading rule. Ask through the propose tool to obtain the list you select; read a held answer without asking it again.`,
|
|
344
|
+
...readingLines,
|
|
345
|
+
`ASK with \`register_propose_supplemental\`: the name's \`axis\` and its band as \`output_path\`, and in \`proposals\` the question with \`nice_classes\` from that name's line and its purpose as \`rationale\`. To read a name's own list, ask \`exact\` on the name. An identical-name read keeps the original scope. Each class added from the client's own goods has its own identical-name question. A narrowing names the crowd it replaces as \`narrows\`. An answer you already hold is not asked again.`,
|
|
346
|
+
`READ with \`read_register_list\`, by qid. The propose tool's answer shows only the first rows of a list; the list is the whole list, and the order it comes in means nothing.`,
|
|
347
|
+
`HAND BACK with \`record_knockout_register_read\`, one row per name, when you are done. THERE IS NO FILE FOR YOU TO WRITE. If you call again, send only the names you are correcting: a name you send replaces its row.`,
|
|
348
|
+
),
|
|
349
|
+
},
|
|
350
|
+
"knockout-assess": {
|
|
351
|
+
// THE LIMIT HAS TO COVER THE WRITING. This stage records one long call at its end, and Codex writes that call in silence,
|
|
352
|
+
// so an attempt killed while writing keeps nothing. Measured in testing, 2026-11-05, with the kill lifted, on saved evidence
|
|
353
|
+
// for eight names in fourteen classes: six Codex draws took 1,043 to 1,331 s and each recorded on its first attempt. At 900 s
|
|
354
|
+
// every one of those would have been killed. Under that limit, four draws with class groups took up to 2,397 s and three of
|
|
355
|
+
// them failed the stage, and two without were accepted, one after a retry. One attempt was killed for 600 s of silence while it wrote.
|
|
356
|
+
model: "opus", thinking: "high", timeoutSec: 1500, stallSec: 900,
|
|
295
357
|
// ── WHAT THIS STAGE READS, AND WHY IT IS THREE DOCUMENTS NOW ──────────────
|
|
296
358
|
//
|
|
297
359
|
// It read one: its own SKILL.md. So it rated in a framework's band words while never seeing that
|
|
@@ -321,6 +383,9 @@ export const KO_STAGES = {
|
|
|
321
383
|
`You are rating chunk ${chunkNo + 1}/${chunkTotal} of a KNOCKOUT batch — triage, not clearance.`,
|
|
322
384
|
`Rate ONLY these marks (one entry each, names verbatim): ${chunkMarks.map((m) => m.name).join(" · ")}.`,
|
|
323
385
|
`The batch plan (context framing, classes, priorities): ${K.plan}`,
|
|
386
|
+
requestLine(K,
|
|
387
|
+
(at) => `THE CLIENT'S OWN REQUEST, VERBATIM: ${at}. Read it before you rate. Its stated goods, services, and intended use lead over the plan; the customer's profile fills gaps. Keep a guessed use as a possibility. Do not use that guess to narrow the instructed scope or lower a rating.`,
|
|
388
|
+
(at) => `AVAILABLE BRIEF: ${at}. The original request is not held here. Read the brief before you rate, keep its stated scope, and distinguish supplied facts from inferred uses. Do not lower a rating on a guessed use.`),
|
|
324
389
|
// ── contextFraming IS A RATING INPUT, AND SAYING SO IS THE OTHER HALF OF THE DOCTRINE ─────────
|
|
325
390
|
//
|
|
326
391
|
// The firm-wide reasoning calibrates on MANNER OF USE — a character name inside a franchise sits
|
|
@@ -328,16 +393,8 @@ export const KO_STAGES = {
|
|
|
328
393
|
// has carried a per-mark `contextFraming` all along and nothing ever told this seat to rate with
|
|
329
394
|
// it, so the requester's per-name detail reached the run and stopped. Shipping the doctrine
|
|
330
395
|
// without pointing at the field it turns on is half a fix.
|
|
331
|
-
`
|
|
332
|
-
|
|
333
|
-
//
|
|
334
|
-
// "the ONLY evidence base" is what stopped this seat weighing filings the same run had already
|
|
335
|
-
// fetched and paid for. Measured on a delivered run: every one of the five filings the reviewing
|
|
336
|
-
// lawyer built her read on was on disk before this stage started, and none was weighed — they
|
|
337
|
-
// reached the client as raw cards with no band. The URL rule stays and is scoped: a cited URL must
|
|
338
|
-
// come from one of the two sources named here, which is the anti-confabulation rule it always was
|
|
339
|
-
// and never a rule about which of the two.
|
|
340
|
-
`Each mark's RAW research payload: the record of its web searches, every spelling on every place, with the listings each search returned and any search that could not run. It holds no summary and no judgment; the judgment is yours. A cited URL must appear in the mark's own research payload or in the register records supplied for that mark.`,
|
|
396
|
+
`Read each name's contextFraming against the client's request. Apply the manner-of-use calibration to the use the client actually states. Where the frame inferred a use, keep it as a possibility; it does not narrow the instructed scope or lower the rating. Correct a material framing error when the request or evidence contradicts it, and explain the correction in the assessment.`,
|
|
397
|
+
`Each mark's RAW research payload: the record of its web searches, every spelling on every place, with the listings each search returned and any search that could not run. It holds no summary and no judgment; the judgment is yours. ${CITED_URL_RULE} The batch's other recorded research payloads and its recorded owner checks are under ${K.researchDir}.`,
|
|
341
398
|
...chunkMarks.map((m) => `- ${m.name}: ${K.research(kebab(m.name))}${m.degraded ? ` (DEGRADED: ${m.degraded} — apply the null-results doctrine, never inflate)` : ""}`),
|
|
342
399
|
// THE ORDERED TERRITORIES, where the request named some. The web questions used to carry them in
|
|
343
400
|
// their own scope lines and drop what fell outside; the grid returns results and judges nothing, so
|
|
@@ -348,8 +405,9 @@ export const KO_STAGES = {
|
|
|
348
405
|
// NAMED ONLY WHEN IT IS ON DISK. The records land at step 2 of 5 and this stage is step 3 or 4, so
|
|
349
406
|
// the file exists by now on a run that fetched them — and on a run that did not, a dispatch naming
|
|
350
407
|
// a path that is not there teaches the seat that a missing file is normal.
|
|
351
|
-
|
|
352
|
-
|
|
408
|
+
registerStateLine(K),
|
|
409
|
+
registerRecordHeld(K)
|
|
410
|
+
? `THE REGISTER FILINGS THIS RUN ALREADY FETCHED — ${K.registerRecords}. Real records, retrieved before you started: owner, jurisdiction, status, classes, dates. Read the held filings and weigh them for the names you are rating, against the client's requested goods. \`goods\` is a short view, \`goodsState\` records completeness, and \`goodsFrom\` records its source. If wording needed for your judgment is shortened or uncertain, read \`fullRecord\` where it is held (its path is under ${K.runDir}). Missing or incomplete wording does not establish that the goods are unrelated. A registration on this list is evidence about the name it names — treat its owner, its scope and its vulnerability the way the firm-wide reasoning tells you to (revocability above the lowest band; an enforcer's portfolio profile; a crowd as a mitigant under its gating precondition). What you may NOT do is describe the lane that fetched them — see the coverage rule below.`
|
|
353
411
|
: "",
|
|
354
412
|
// ── WHAT THE OWNER ACTUALLY SELLS, ALREADY SEARCHED ────────────────────────────────────────────
|
|
355
413
|
//
|
|
@@ -370,7 +428,7 @@ export const KO_STAGES = {
|
|
|
370
428
|
`WHAT THESE OWNERS ACTUALLY SELL — the driver ran ONE scoped web search per promoted filing's proprietor BEFORE this stage, so you are not guessing from the company name. Payloads:`,
|
|
371
429
|
...ownerCheckLines(K),
|
|
372
430
|
`USE THEM. When you write a registerReads row for one of these filings, your "read" must state what the owner actually sells ACCORDING TO THAT PAYLOAD, not what the company's name suggests and not what its class numbers imply. An owner's name is not evidence of its trade. A company name that reads as a line of business is a guess that happens to land sometimes, and the run where it lands is indistinguishable from the run where it does not — which is the reasoning this rule exists to stop.`,
|
|
373
|
-
`WHERE A PAYLOAD SAYS THE SEARCH FOUND NOTHING, say that plainly in the read — "a search for the proprietor's trade returned nothing" — and reason from the register record alone. Do NOT substitute an inference from the owner's name for the answer the search did not give. The report prints the source line
|
|
431
|
+
`WHERE A PAYLOAD SAYS THE SEARCH FOUND NOTHING, say that plainly in the read — "a search for the proprietor's trade returned nothing" — and reason from the register record alone. Do NOT substitute an inference from the owner's name for the answer the search did not give. The report prints the filing card's owner-check source line from the driver's record. A finding may cite a supporting URL from the saved owner check under the held-source rule.`,
|
|
374
432
|
].join("\n")
|
|
375
433
|
: "",
|
|
376
434
|
// ── THE READ REACHES THE PAGE ────────────────────────────────────────────
|
|
@@ -384,30 +442,10 @@ export const KO_STAGES = {
|
|
|
384
442
|
// the record store above and refuses one it does not hold, so a Register label can never appear on
|
|
385
443
|
// a finding with no register evidence. Omitting either field is always safe: the card keeps its
|
|
386
444
|
// neutral line, which describes the card and is true.
|
|
387
|
-
|
|
388
|
-
? `WHEN YOU WEIGH ONE OF THOSE FILINGS, SAY SO BY ITS OWN ID — copy "recordId" verbatim from the file above. "registerReads" on the MARK: rows of ${frameworkMethod ? "{recordId, read, band?, inputs?}" : "{recordId, read, band?}"} for a filing you weighed that did NOT become a findings[] record; "read" is what you concluded about THAT filing — whether it bears on the rating and why — and it prints on that filing's card in the reader's own report. "band" is OPTIONAL and is your rating of THAT filing on its own, in the framework's band words: send it whenever you formed a view on the filing itself, because a registered right left unbanded is the only card on the page with no rating while softer uses beside it carry one, which reads as though the registration mattered least. Omit it and your read still prints, claiming no rating.${frameworkMethod ? ' A row that carries "band" also carries "inputs", the framework\'s own inputs for that filing; a row with no band carries none.' : ""} "weighedFilings" on a FINDING: the recordIds whose evidence your reasoning for that conflict actually used, because the report derives that finding's source labelling from it. Both are optional and both are joined against the filings you were given, so an id we do not hold is refused by name. A filing you did not weigh simply gets no row: do not invent a read to fill one, and never write "not weighed" as a read.`
|
|
445
|
+
registerRecordHeld(K)
|
|
446
|
+
? `WHEN YOU WEIGH ONE OF THOSE FILINGS, SAY SO BY ITS OWN ID — copy "recordId" verbatim from the file above. "registerReads" on the MARK: rows of ${frameworkMethod ? "{recordId, read, band?, inputs?}" : "{recordId, read, band?}"} for a filing you weighed that did NOT become a findings[] record; "read" is what you concluded about THAT filing — how its goods meet the goods the client asked about, whether it bears on the rating, and why — and it prints on that filing's card in the reader's own report. "band" is OPTIONAL and is your rating of THAT filing on its own, in the framework's band words: send it whenever you formed a view on the filing itself, because a registered right left unbanded is the only card on the page with no rating while softer uses beside it carry one, which reads as though the registration mattered least. Omit it and your read still prints, claiming no rating.${frameworkMethod ? ' A row that carries "band" also carries "inputs", the framework\'s own inputs for that filing; a row with no band carries none.' : ""} "weighedFilings" on a FINDING: the recordIds whose evidence your reasoning for that conflict actually used, because the report derives that finding's source labelling from it. Both are optional and both are joined against the filings you were given, so an id we do not hold is refused by name. A filing you did not weigh simply gets no row: do not invent a read to fill one, and never write "not weighed" as a read.`
|
|
389
447
|
: "",
|
|
390
|
-
`A DEGRADED mark's row must carry degraded:true and the purple "Manual verification recommended"`,
|
|
391
|
-
`note; a mark WITH a payload must never claim degraded (the validator joins both against the disk).`,
|
|
392
448
|
`The FROZEN framework in force (rate in ITS band vocabulary, highest→lowest ${framework.bands.map((b) => b.label).join(" · ")}): ${driverDir(K.runDir, "framework.json")}`,
|
|
393
|
-
// — the band is dictated here because the CODE cannot supply it: the rating is the author's
|
|
394
|
-
// judgment about blocking power, and the machine can only check that what came back is a word from
|
|
395
|
-
// the ladder above. The ORDINAL is a different case, and the wording below says so: the machine
|
|
396
|
-
// ranks on the band and renumbers 1…N (findings-model.mjs validateKnockoutFindings), because the
|
|
397
|
-
// number is a drill-through key printed as a range in the audit trail, and a gap in it makes that
|
|
398
|
-
// cell assert findings the run does not hold. What is asked for here is the author's ORDER, which
|
|
399
|
-
// is what breaks ties inside a band. The shape itself is the skill's (SKILL.md "The finding
|
|
400
|
-
// record"); this says the two things that are per-TURN — that the ladder named on the line above
|
|
401
|
-
// is also the per-finding vocabulary, and that the numbering restarts at each mark.
|
|
402
|
-
`EVERY conflicting name is a typed findings[] record — {ordinal, name, owner, band, ${frameworkMethod ? "inputs, " : ""}net, type,`,
|
|
403
|
-
`evidence[], basis}, closed keys. Its "band" is a word from the SAME ladder as the mark's rating`,
|
|
404
|
-
`(never HIGH/MEDIUM/LOW and never a number), and "ordinal" restarts at 1 for EACH mark, most`,
|
|
405
|
-
`blocking first. The code re-ranks on the band and renumbers, so your order decides ties inside a`,
|
|
406
|
-
`band — never cite a finding by its number in prose. A named conflict belongs in findings[], not`,
|
|
407
|
-
`in bullets — write it once.`,
|
|
408
|
-
// — where the customer's framework states a method (framework-method.mjs), the band is its
|
|
409
|
-
// table's answer to inputs the seat records on each finding, and the driver checks the two
|
|
410
|
-
// agree. With no method both lines are empty and the message reads exactly as before.
|
|
411
449
|
frameworkMethod ? methodDictation(frameworkMethod) : "",
|
|
412
450
|
frameworkMethod ? `- inputs: ${inputsShape(frameworkMethod)} — the framework's own inputs for this finding, each one of the values it lists, reasoned in its order before the band. On every rated finding.` : "",
|
|
413
451
|
// A seam for a note about Depth 2, and it stays UNUSED on purpose (2026-07-22). The counts
|
|
@@ -450,61 +488,22 @@ export const KO_STAGES = {
|
|
|
450
488
|
// The depth rule is not stylistic. `# ` opens a SECTION of the delivered report — parseSections
|
|
451
489
|
// splits on /^# /m and batchSummaryOf terminates on it — so a single hash written here ends the
|
|
452
490
|
// client's summary at that line and drops everything after it, silently, on the entry point.
|
|
453
|
-
`EVERY mark ALSO carries "assessment": the opening read a reader of THIS MARK'S OWN report meets first, before any table. Write it for a client who ordered this one name and nothing else: what the name is, what the landscape around it looks like, what drives the rating.`,
|
|
454
|
-
`GIVE IT STRUCTURE A READER CAN SCAN — that is what changed. Sub-headers where the content divides, "- " bullets for the load-bearing points, a blank line between blocks. A sub-header is "## " or "### ". NEVER "# ": one hash opens a section of the report itself, and a summary that opens a section ends there and takes the rest of itself off the client's page. A single sub-header over one unbroken block is not structure — the blocks are what make the length readable, and unstructured length is the complaint this replaces.`,
|
|
455
|
-
`KEEP THE LENGTH. It is still the most useful part of a triage and it is still not rationed. What it now has to be is CONSISTENT: this mark's opening read is the scale of a single-mark report's opening read, and the marks of one batch sit within reach of each other. One assessment several times the size of its siblings is out of family. No word count and none is coming — judge it against the other marks in front of you.`,
|
|
456
|
-
`SYNTHESISE THE SOURCES, DO NOT SHELVE THEM SEPARATELY. Where filings were handed to you for this mark, weigh them in the SAME passage as the marketplace and common-law reading — what the screened field shows, what those filings do to that reading, and what the two together mean for the band. A reader must not be handed one block per source and left to reconcile them.`,
|
|
457
|
-
`IT NAMES THIS MARK AND NO OTHER. Each mark's report is delivered on its own, to a reader who may have ordered only that name, so a sibling's name appearing in this paragraph is another client's mark on this client's page. Do not compare across the batch here — the cross-mark reading is what "chunkSummary" is for, and it has its own page.`,
|
|
458
|
-
`EVERY mark carries the READ as TYPED FIELDS, not as a paragraph:`,
|
|
459
|
-
` "basis" ONE sentence: why this band, for this name, in these classes.`,
|
|
460
|
-
` "factors" 2-4 strings, one line each — the load-bearing observations behind the band.`,
|
|
461
|
-
` "counterFactors" 1-3 strings — what holds it at this band rather than the next one either way.`,
|
|
462
|
-
` "mitigation" ONE line: the single thing that would move it. "" if nothing would.`,
|
|
463
|
-
`Each is a standalone line: no semicolon chains, no clause stacking, no restating the band word.`,
|
|
464
|
-
`Write each observation ONCE — a point made in "factors" is not repeated in "bullets".`,
|
|
465
|
-
// The other half of part 2's ruling, enforced here rather than hoped for. The live 2026-08-11
|
|
466
|
-
// report carried "the register overlay has not been run" directly under a table of register counts
|
|
467
|
-
// the same run had taken. The turn was not lying: it is never shown the count lane's output (rule 1
|
|
468
|
-
// of register-count.mjs) and it filled the gap with the only thing it had. Nobody who cannot see
|
|
469
|
-
// the machinery describes it — the renderer owns that sentence and writes it from the sidecars.
|
|
470
|
-
`SAY NOTHING ABOUT WHETHER THE REGISTER LANE RAN — whether registers were searched, counted,`,
|
|
471
|
-
`overlaid or checked, how many filings exist, or how far the search reached. Not in any field, not`,
|
|
472
|
-
`in the chunk summary. You cannot see that lane; the report states its coverage in code from the`,
|
|
473
|
-
`run's own measurements, and the validator refuses a chunk that speaks for it.`,
|
|
474
|
-
`THAT IS A RULE ABOUT THE LANE, NOT ABOUT THE FILINGS. Where records are given to you above, WEIGH`,
|
|
475
|
-
`them: whose they are, what they cover, what they are worth against this name. A filing you were`,
|
|
476
|
-
`handed is evidence like any other and reasoning about it is the job.`,
|
|
477
|
-
// — THE GROUPED PAGE'S ENTRY POINT, AND IT WAS ORDERED AS ONE BLOCK TOO.
|
|
478
|
-
// The owner's report on this surface was the same as the per-mark one: "just one block of text —
|
|
479
|
-
// no sub-headers, bullet points etc. Very hard to digest. This is an important part of the report
|
|
480
|
-
// — it's the entry point." The order below said "measured sentences" and the doctrine file said
|
|
481
|
-
// "narrative, not bullets"; both moved together, because a seat given two answers picks one.
|
|
482
|
-
// It stays the SHORTER digest that sits above the per-mark assessments — that is the owner's
|
|
483
|
-
// ordering and it is unchanged. Structure is what it gains, not size.
|
|
484
|
-
`EVERY chunk includes "chunkSummary": the cross-mark read covering THIS chunk's marks (code`,
|
|
485
|
-
`concatenates the chunks into the batch executive summary — a mark missing from its chunkSummary`,
|
|
486
|
-
`is missing from the report summary).`,
|
|
487
|
-
`STRUCTURE IT: a short opening line for what the batch as a whole shows, then one "## <MARK NAME>"`,
|
|
488
|
-
`sub-header per mark with its band and the one or two things that drive it, bullets where they`,
|
|
489
|
-
`help. Same depth rule as the per-mark assessment — "## " or "### ", never "# ".`,
|
|
490
|
-
`IT IS THE SHORTER DIGEST ABOVE THE PER-MARK ASSESSMENTS, not a rival to them. A reader opens this`,
|
|
491
|
-
`to decide which name to read about; the mark's own page is where the full read lives. Keep it`,
|
|
492
|
-
`tighter than any one mark's assessment.`,
|
|
493
|
-
// ── THE RETURN IS A CALL, NOT A FILE (item B) ────────────────────────────
|
|
494
491
|
//
|
|
495
|
-
// THE
|
|
496
|
-
// spent 2026-08 writing its chunk through a Bash redirect because the Write tool was already
|
|
497
|
-
// refused under `_driver/`; closed that bypass and the stage broke the same day, its
|
|
498
|
-
// corrective ladder exhausting against a dispatch that ordered a write nothing would permit. The
|
|
499
|
-
// relocation to the run root fixed the permission. This removes the order itself: there is no path
|
|
500
|
-
// here to hold, the seat's grant carries no Write, and the driver writes the chunk from values.
|
|
492
|
+
// ── THE WHOLE CONTRACT, IN ONE INSTRUCTION (design, 2026-11-06) ───────────────────────────────────────
|
|
501
493
|
//
|
|
502
|
-
//
|
|
503
|
-
//
|
|
504
|
-
//
|
|
505
|
-
//
|
|
494
|
+
// Reviewing the knockout against the lawyer's original instructions, design kept the full opening, its structure, a broadly
|
|
495
|
+
// consistent scale across the batch and the typed fields' requirements; an earlier proposal to shorten the opening and drop
|
|
496
|
+
// those requirements was withdrawn. The line below says so to the rating step and changes none of it: the manual's "keep
|
|
497
|
+
// the length" and the validators' minimums stand. Model words, landed as approved.
|
|
498
|
+
`Give each name a complete opening assessment for a client reading that name's report alone. Explain the relevant landscape, what drives the rating, and what matters for the client's decision. Preserve the established depth and a broadly consistent scale across the batch. Use sub-headings, short paragraphs and bullets to make the assessment easy to scan. Keep the existing structured fields and their requirements. Do not invent observations or repeat a point merely to fill space; preserve the material supporting and contrary facts, goods and class distinctions, implications and search limitations needed to understand the advice. The batch summary compares the names separately and does not replace any name's own opening assessment.`,
|
|
499
|
+
`SAY NOTHING ABOUT WHETHER THE REGISTER LANE RAN — whether registers were searched, counted, overlaid or checked, how many filings exist, or how far the search reached. Not in any field, not in the chunk summary. The report states its coverage in code from the run's own measurements, and the validator refuses a chunk that speaks for it. That is a rule about the lane, not about the filings: a filing you were handed is evidence like any other.`,
|
|
500
|
+
`EVERY conflicting name is a typed findings[] record. A named conflict belongs in findings[], not in bullets — write it once.`,
|
|
501
|
+
`The manual sets out each mark's record: its \`findings[]\`, its opening read in \`assessment\`, its typed read, and the chunk's \`chunkSummary\`, which code joins into the batch summary, so a mark missing from it is missing from the report.`,
|
|
506
502
|
`HAND YOUR RATINGS BACK BY CALLING \`record_knockout_assess\`. THERE IS NO FILE FOR YOU TO WRITE and this dispatch names none — the driver writes this chunk itself from what you send, and nothing you write by hand is read. You are not told which chunk number to send and there is no field for it: the driver bound that when it dispatched you.`,
|
|
507
|
-
|
|
503
|
+
// A REPAIR SENDS ONLY WHAT CHANGED (design, 2026-11-06). The recorder merges a correction onto the written record field by field
|
|
504
|
+
// and validates the assembled record, so re-sending a whole name to fix one sentence was output the contract asked for and the
|
|
505
|
+
// merge never needed. A refused first call writes nothing, so it is no base: a partial first call is still refused.
|
|
506
|
+
`On the first call, send the complete assessment. Once the tool has confirmed a written record for this chunk, correct a name by sending its exact name and only the fields you changed. Omitted names and omitted fields within a name keep their recorded values. A field you send replaces that whole field: send a changed list or object complete, including unchanged entries. Update the chunk summary when the correction changes it. If the tool has written no record, send the complete corrected assessment.`,
|
|
508
507
|
chunkNo === 0
|
|
509
508
|
? `As the FIRST chunk you also send \`batch\` (productContext, standardCaveats) and \`framework\`.`
|
|
510
509
|
: `As a CONTINUATION chunk you send \`marks\` and \`chunkSummary\` only — batch and framework came from chunk 1.`,
|
|
@@ -533,12 +532,13 @@ export const KO_STAGES = {
|
|
|
533
532
|
// that the replacement reads better than what it replaced. A cheaper rung would produce replacements
|
|
534
533
|
// nobody would ship, which is a pass that runs and achieves nothing.
|
|
535
534
|
"knockout-review": {
|
|
536
|
-
model: "opus", thinking: "high", timeoutSec:
|
|
535
|
+
model: "opus", thinking: "high", timeoutSec: 900, stallSec: 600,
|
|
537
536
|
// DECLARATIVE ONLY on this lane, exactly as the assess stage records: nothing in koStage reads
|
|
538
537
|
// `skillReads`, and the effective read is the `reads([...])` call in the message below. The two are
|
|
539
538
|
// edited together and the asymmetry is written down rather than left to be discovered.
|
|
540
|
-
skillReads: ["skills/clearance-search/report-prose.md"],
|
|
541
|
-
|
|
539
|
+
skillReads: ["skills/knockout-assess/SKILL.md", "skills/clearance-search/firm-wide-reasoning.md", "skills/clearance-search/report-prose.md"],
|
|
540
|
+
// A later pass reads the corrected record, under its own artifact: `knockout-review#1`.
|
|
541
|
+
out: (K, pass) => (pass ? knockoutReviewFile(K.runDir, pass) : K.review),
|
|
542
542
|
validate: validateKnockoutReviewFile,
|
|
543
543
|
// ── THE MESSAGE PROMISES A TABLE ONLY WHEN IT HAS ONE ──────────────────────────
|
|
544
544
|
//
|
|
@@ -550,13 +550,35 @@ export const KO_STAGES = {
|
|
|
550
550
|
// exists to stop. A record the driver's read flags nowhere is handed its first-read lines instead,
|
|
551
551
|
// by the owner's ruling of 2026-10-10, so both branches have rows under them; a record with no such
|
|
552
552
|
// line is not dispatched at all.
|
|
553
|
-
message: ({ K, evidenceLines = [], firstReadLines = [], exclusionNote = "" }) => lines(
|
|
553
|
+
message: ({ K, frameworkPath = null, evidenceLines = [], firstReadLines = [], exclusionNote = "", recheckTable = "", sourceAnswers = [] }) => lines(
|
|
554
554
|
// THE CLIENT'S QUESTION LEADS, in the owner's words (ruling 2026-09-24), ahead of the rewrite job.
|
|
555
555
|
`Does the report answer the client's question: who could object, how strong they are, what the client should do? Are the marks a lawyer would list present, and is each position written from the record that matters? Answer that before any check on wording.`,
|
|
556
|
-
reads(["skills/clearance-search/report-prose.md"]),
|
|
557
|
-
`You are the
|
|
556
|
+
reads(["skills/knockout-assess/SKILL.md", "skills/clearance-search/firm-wide-reasoning.md", "skills/clearance-search/report-prose.md", frameworkPath].filter(Boolean)),
|
|
557
|
+
`You are the INDEPENDENT CHECK on a knockout screen: another step rated this batch. Check what the client is told against the request, the framework and the evidence, then check its wording. You change no band and no finding yourself.`,
|
|
558
|
+
`Apply the frozen framework, the knockout assessment manual and shared firm-wide reasoning. Read report-prose.md for writing standards; its links do not import clearance-only finding or placement rules into this screen. An unidentified owner is an explicit evidence gap, not by itself grounds to remove or lower a finding's band. Never invent attribution or a right; explain what the held evidence supports and what remains uncertain.`,
|
|
559
|
+
requestLine(K, (at) => `The client's request, as it arrived: ${at}`, (at) => `The available brief: ${at}. The original request is not held here.`),
|
|
560
|
+
recheckTable
|
|
561
|
+
? [`THIS IS THE SECOND LOOK. An earlier check raised the defects below. The table says what the driver saw of each, including any the rating step did not answer, and the record you are reading is the record as it now stands.`,
|
|
562
|
+
recheckTable,
|
|
563
|
+
`Recheck every material defect raised by the first review, every changed answer and summary, and any other conclusion that the changes could affect. Unchanged text does not by itself establish that a conclusion is unaffected. Consult the whole held batch and its evidence where needed; if you cannot bound the effects of a change, check the full batch. Keep unresolved defects visible and report any additional material defect you discover. Do not restart a prose edit of accepted text outside the affected scope.`,
|
|
564
|
+
`A changed finding or band must agree with its name's basis, factors, opening read and block in the batch summary. There is no further correction after this one, so send as \`material\` only what is still wrong; it stays on the record for the reviewing lawyer.`].join("\n")
|
|
565
|
+
: [
|
|
566
|
+
// THE FIRST LOOK IS A KNOCKOUT CHECK (design, 2026-11-06): the requested scope, the material conflicts, their support and
|
|
567
|
+
// the answer's agreement with itself, not another search and not a copy-edit. A clean read is recorded once; the recorder
|
|
568
|
+
// still refuses an empty call, so a completed review stays on the record as a row and never as an absence.
|
|
569
|
+
`Check this as a knockout: does the answer address the actual request, carry the material exact or near-exact conflicts, use held support, and agree with itself? Challenge a supported judgment only for a material defect, not because you would phrase it differently. Follow a specific concern into the held evidence where needed; do not repeat the entire search or expand the product's scope. Rewrite only wording that obscures or misstates the answer, preserving its facts and reasons. If no change is needed, record that once; do not explain every unchanged line. A later recheck checks the original defects, repairs and their consequences, not another general prose edit.`,
|
|
570
|
+
`MATERIAL DEFECTS COME FIRST. A defect is material when repairing it would change what the client is told: a band the framework and the evidence do not support, including one band where the evidence divides the requested goods, or a division it does not support (\`band\`), a filing or use a lawyer would raise that the answer leaves out (\`missing\`), something set aside against the evidence (\`exclusion\`), scope the request asked for that the answer does not cover, including reasoning that never connects the requested use and the held goods to the conclusion (\`scope\`), or a line that contradicts the record beneath it (\`contradiction\`). Send each as a \`material\` row: \`kind\`, \`mark\` verbatim, the finding's ordinal as \`finding\` where it is about one, and what is wrong and why it matters as \`problem\`. Identify the held evidence behind the defect in rests_on. A defect about scope, the framework, or internal agreement may instead identify the supplied request passage, framework rule, or rated field in problem. Do not invent a filing or URL to justify that defect. A filing held for this batch may bear on more than one name, so a defect on one name may rest on a filing held under another, by its held recordId and source. You repair nothing: the step that rated the batch answers each row, and the record is then read again. A rating a lawyer could reasonably reach is not a defect, and neither is a preference about wording.`,
|
|
571
|
+
],
|
|
572
|
+
`Each name's research payload is under ${K.researchDir}.`,
|
|
573
|
+
`rests_on takes a recordId, a question qid, or a URL from ${PERMITTED_SOURCES}. A failed question's qid supports a statement about the failure, not a finding about filings the question never returned. ${SIBLING_SOURCE}`,
|
|
574
|
+
sourceAnswers.length
|
|
575
|
+
? [`THESE CITATIONS WERE LEFT OUT AS NOT HELD, AND THE FINDINGS THAT CITED THEM CHANGED AFTERWARDS. Read each against that problem: a claim still without held support is a material defect.`, ...sourceAnswers].join("\n")
|
|
576
|
+
: "",
|
|
577
|
+
`THE WORDS COME AFTER. A line a reader meets before opening anything is held to this rule.`,
|
|
558
578
|
`THE RULE. A line a reader meets before opening anything carries no legal or engine vocabulary and no sentence longer than 25 words. Inside a fold the lawyer's words are allowed where a plain one would lose precision; on a default-visible line they are not. The reader here is the client of the lawyer who ordered this screen, and they read the same page.`,
|
|
559
579
|
`The rated record: ${K.findings}. Read it — the lines named below are quoted from it and you are rewriting them in place.`,
|
|
580
|
+
existsSync(K.registerRecords) ? `The register record behind it: ${K.registerRecords}. It holds what the reading step carried, what it set aside and why.` : "",
|
|
581
|
+
`Where this run read the register, \`read_register_list\` reads any of its lists whole, by qid, and fetches nothing. Use it to answer the first question; a rewrite still adds no fact the rating did not weigh.`,
|
|
560
582
|
evidenceLines.length
|
|
561
583
|
? `THE DRIVER MEASURED THESE LINES. Each row is the line, the ADDRESS that names it, and what a deterministic read found. THIS IS EVIDENCE, NOT A VERDICT: judge each in context and pass over any where the word is the subject rather than the profession's shorthand. ${exclusionNote}`
|
|
562
584
|
: `THE DRIVER'S READ FLAGGED NO LINE ON THIS RECORD, so nothing below is evidence of a fault. These are the lines a reader meets first, each with the ADDRESS that names it. Rewrite one only where it would answer the client's question more plainly; if every line already does, send one \`declined\` row at one of these addresses saying so, rather than inventing a rewrite to fill the call.`,
|
|
@@ -567,11 +589,50 @@ export const KO_STAGES = {
|
|
|
567
589
|
// happen. The address IS the field, so every rewrite this stage returns names the exact line it
|
|
568
590
|
// replaces and the driver writes it there.
|
|
569
591
|
`Send your answer to that first question as \`first_question\` in the same call.`,
|
|
570
|
-
`HAND YOUR
|
|
592
|
+
`HAND YOUR ANSWER BACK BY CALLING \`record_knockout_review\`. THERE IS NO FILE FOR YOU TO WRITE and this dispatch names none for you to write to. Send \`material\` as above, and \`rewrites\`: one row per line you are replacing, each carrying the \`at\` address COPIED VERBATIM from the row above and \`text\`, the replacement prose. The driver writes your text into that field exactly as you send it.`,
|
|
571
593
|
`A REWRITE KEEPS EVERY FACT. You are changing the register, never the content: the same band, the same names, the same reasons, the same conclusion, in the words the reader already owns. Splitting one long sentence into two short ones is the commonest right answer. Dropping the reason to make a line shorter is the commonest wrong one.`,
|
|
572
|
-
`
|
|
573
|
-
`YOU MOVE NOTHING ELSE. No band, no finding, no ordinal, no count, no piece of evidence and no caveat the engine wrote. There is no field for any of them and a payload naming one is refused.`,
|
|
594
|
+
`A REWRITE MOVES NOTHING ELSE. No band, no finding, no ordinal, no count, no piece of evidence and no caveat the engine wrote. There is no field for any of them and a payload naming one is refused.`,
|
|
574
595
|
`IF YOU CALL AGAIN, SEND ONLY WHAT YOU ARE CORRECTING. The driver merges BY ADDRESS onto what it already accepted, so a row you omit keeps what you sent for it before.`,
|
|
575
596
|
),
|
|
576
597
|
},
|
|
598
|
+
// A MATERIAL DEFECT'S REPAIR. Dispatched only when the check raised one, per chunk, on the chunk as rated. Its answer is its own
|
|
599
|
+
// artifact because the chunk it changes is already valid: a turn that called nothing would otherwise pass.
|
|
600
|
+
"knockout-correct": {
|
|
601
|
+
model: "opus", thinking: "high", timeoutSec: 1200, stallSec: 600,
|
|
602
|
+
// DECLARATIVE ONLY on this lane, as the assess stage records; the effective read is in the message.
|
|
603
|
+
skillReads: ["skills/knockout-assess/SKILL.md", "skills/clearance-search/firm-wide-reasoning.md"],
|
|
604
|
+
out: (K, chunkNo) => knockoutCorrectionFile(K.runDir, chunkNo),
|
|
605
|
+
validate: validateKnockoutCorrectionFile,
|
|
606
|
+
message: ({ K, job = {}, chunkNo, work = null, chunkMarks = [], frameworkPath = null, frameworkMethod = null }) => {
|
|
607
|
+
const asRated = (() => { try { return JSON.parse(readFileSync(K.assessChunk(chunkNo), "utf8")); } catch { return null; } })();
|
|
608
|
+
const scope = chunkScope(work, chunkNo, asRated);
|
|
609
|
+
const ordinalOf = (d) => (asRated?.marks ?? []).find((m) => m?.name === d.mark)?.findings?.find((f) => sameFinding(f, d.names))?.ordinal;
|
|
610
|
+
const named = new Set(scope.defects.map((d) => d.mark));
|
|
611
|
+
return lines(
|
|
612
|
+
reads(["skills/knockout-assess/SKILL.md", frameworkPath, "skills/clearance-search/firm-wide-reasoning.md"].filter(Boolean)),
|
|
613
|
+
`An independent check read this rated batch and raised the defects below. Repair what the evidence supports, and nothing else.`,
|
|
614
|
+
requestLine(K,
|
|
615
|
+
(at) => `THE CLIENT'S OWN REQUEST, VERBATIM: ${at}. Read it before you rate. Its stated goods, services, and intended use lead over the plan; the customer's profile fills gaps. Keep a guessed use as a possibility. Do not use that guess to narrow the instructed scope or lower a rating.`,
|
|
616
|
+
(at) => `AVAILABLE BRIEF: ${at}. The original request is not held here. Read the brief before you rate, keep its stated scope, and distinguish supplied facts from inferred uses. Do not lower a rating on a guessed use.`),
|
|
617
|
+
`The record as rated: ${K.assessChunk(chunkNo)}. The ordinals you use are the ones in that file.`,
|
|
618
|
+
`The batch plan: ${K.plan}. The frozen framework's bands: ${driverDir(K.runDir, "framework.json")}.`,
|
|
619
|
+
`Each name's research payload: ${chunkMarks.filter((m) => named.has(m.name)).map((m) => K.research(kebab(m.name))).join(" · ")}. The batch's other recorded research payloads are under ${K.researchDir}.`,
|
|
620
|
+
existsSync(K.ownerChecks) ? `The recorded owner checks, with the owner and filing each belongs to: ${K.ownerChecks}.` : "",
|
|
621
|
+
existsSync(K.registerRecords) ? `The filings this run read: ${K.registerRecords}. \`read_register_list\` reads any question's whole list by qid, and fetches nothing.` : "",
|
|
622
|
+
orderedTerritories(job).length ? `THE TERRITORIES THIS SCREEN WAS ORDERED FOR: ${orderedTerritories(job).join(", ")}. A use found only outside them is out of scope for this screen.` : "",
|
|
623
|
+
`THE DEFECTS.`,
|
|
624
|
+
...scope.defects.map((d) => `${d.n}. [${d.kind}] "${d.mark}"${d.names ? `, finding ${ordinalOf(d) ?? "?"} (${d.names.name})` : ""}: ${d.problem}${d.rests_on?.length ? ` Rests on: ${d.rests_on.join(", ")}.` : ""}`),
|
|
625
|
+
`A DEFECT IS ANOTHER READER'S FINDING, NOT AN ORDER. Check it against the evidence. Where it holds, repair the finding or the rating. Where it does not, leave the record and say why.`,
|
|
626
|
+
frameworkMethod ? methodDictation(frameworkMethod) : "",
|
|
627
|
+
frameworkMethod ? `- inputs: ${inputsShape(frameworkMethod)} — the framework's own inputs for this finding, each one of the values it lists, reasoned in its order before the band. On every rated finding.` : "",
|
|
628
|
+
`HAND BACK BY CALLING \`record_knockout_correction\`, sending only what changes. THERE IS NO FILE FOR YOU TO WRITE. For a name: the fields that change. A finding goes back whole under its ordinal, and a new one takes the next ordinal. A name no defect concerns stays unchanged. Within an affected name, repair the findings and dependent answers needed to resolve the defect, and explain their connection to it. Leave unrelated findings unchanged.`,
|
|
629
|
+
`A filing held for this batch may bear on more than one name. Weigh it against the particular name and its instructed scope, and cite its held recordId and source. Keep where it was found: using that filing does not mean its original search answered this name's register question.`,
|
|
630
|
+
`${CITED_URL_RULE} ${SIBLING_SOURCE}`,
|
|
631
|
+
OWNER_SOURCE,
|
|
632
|
+
`BRING EVERY DEPENDENT ANSWER WITH IT. Whatever the repair changes, the name's lines that rest on it change with it: \`basis\`, \`factors\`, \`counterFactors\`, \`mitigation\`, \`assessment\`, \`bullets\`, \`classGroups\`, \`classesDriving\`, its \`registerReads\` and its block in \`chunkSummary\`. A rating that moves needs \`basis\`, \`assessment\` and \`chunkSummary\` in the call. The manual's rules still hold: a name is never rated above its worst card.`,
|
|
633
|
+
`REMOVING A FLAGGED FINDING DOES NOT ANSWER ITS DEFECT ON ITS OWN. Use \`remove_findings\` only where the evidence shows the finding should not be there, and say so.`,
|
|
634
|
+
`ANSWER EVERY DEFECT in \`answers\`: \`defect\`, \`outcome\` (\`changed\` or \`stands\`), \`why\`, and in \`findings\` the ordinal of any finding this repair moved beyond the one the defect names. If you call again, send only what you are correcting.`,
|
|
635
|
+
);
|
|
636
|
+
},
|
|
637
|
+
},
|
|
577
638
|
};
|
package/driver/stages.mjs
CHANGED
|
@@ -664,6 +664,10 @@ export function inquiryRungDirective(depth) {
|
|
|
664
664
|
* ABSENT PARAMETERS MEAN NO DIRECTIVE, which is what byte-identical means for the ungraded product: it
|
|
665
665
|
* is told nothing new, rather than told a permissive version of the rule.
|
|
666
666
|
*/
|
|
667
|
+
// — RETIRED FROM THE SYNTHESIS DISPATCH, and kept as a tombstone like profileRungDirective above (design, 2026-11-06). The
|
|
668
|
+
// synthesis call records sections only, and its own message says per-finding write-ups are not a field, so this directive's rules
|
|
669
|
+
// for those write-ups contradicted the message it rode in. Nothing calls it. The depth fields it read stay, because the narrative's
|
|
670
|
+
// depth check still reads them for an older narrative that does carry per-finding prose.
|
|
667
671
|
export function proseRungDirective(depth, bandOrder = null) {
|
|
668
672
|
const rank = Number(depth?.narrativeKeptBandRank);
|
|
669
673
|
const maxWords = Number(depth?.narrativeWriteUpWords);
|
|
@@ -3133,8 +3137,6 @@ export const STAGES = {
|
|
|
3133
3137
|
// confusion. Conditional read (frameworkFor pattern); doctrine TABLES live elsewhere, untouched.
|
|
3134
3138
|
reads(synthesisSkillReads({ profile, job })),
|
|
3135
3139
|
`Produce the joint synthesis narrative (dominant-element spine, cross-pollination Option-D cap N=10, actual-use check, owner workup on high-risk findings, rate each conflict net of merits defences UNDER THE FRAMEWORK YOU JUST READ — state the likelihood of confusion in plain words, then give the band those words require under the framework's own definitions (the prose and the band are one judgment and may not disagree), coverage honesty). WHERE THE MATTER RATIFIED MORE THAN ONE FORM OF THE NAME — a second spelling the instruction told you to read as a variant of the same candidate — REASON EACH FORM THROUGH THE FRAMEWORK ON ITS OWN, then say in the narrative which conflicts move between them and why, naming the form each read belongs to. A conflict that turns on one form exactly is not the same exposure for the other, and a reader choosing between the forms cannot act on a single undifferentiated read. Where every conflict lands the same on both, say so in one line — "the reads are the same for both forms" — as an asserted finding rather than a silence: a reader must be able to tell a matter where the forms do not differ from one where nobody looked. This changes the NARRATIVE and nothing about the report's shape: one overall band as today, and never a second one.`,
|
|
3136
|
-
// — the prose rung. Empty on a one-country run, and `lines` drops it.
|
|
3137
|
-
proseRungDirective(depth, framework?.bands ?? null),
|
|
3138
3140
|
// doc 50 — THE RATING AUTHORITY: the framework read above (the customer's own, or the Generic default)
|
|
3139
3141
|
// rates this matter. All framework-derived strings below come from the FROZEN manifest — never hardcoded.
|
|
3140
3142
|
framework ? `FRAMEWORK IN FORCE (the rating authority for this customer): ${framework.title} — rate every conflict by reasoning through ITS band definitions (Legal position first, then Practical position, then Potential outcomes — or its matrix where it states one). Its bands, highest to lowest, are EXACTLY: ${framework.bands.map((b) => b.label).join(" / ")}. Voice the client side as it does: "${framework.entity_label}". Where the framework states ceilings or matrix mappings, honour them exactly as written — they are its own anti-escalation mechanism; no practical or optics factor lifts a rating past what its stated method yields. A conflict ${framework.entity_label} clearly wins with no material risk is NOT a rated conflict: give it NO band — disposition "off-field" (commercial awareness) if worth the client knowing, else omit it. The framework's lowest band (${framework.bands[framework.bands.length - 1].label}) is for real-but-manageable residual risk — nuisance claims, weak strategic complaints, registration obstacles — never for clear wins.${frameworkMethod ? `\n${methodDictation(frameworkMethod)}` : ""}` : "", // + the framework's stated method, only where it states one (framework-method.mjs)
|