orkeon-code 1.0.0-rc.2 → 1.0.0-rc.3
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/.orkeon-runtime +3 -2
- package/.orkeon-version +1 -1
- package/README.fr.md +1 -1
- package/README.md +1 -1
- package/orkeon-code +307 -74
- package/orkeon-code.ps1 +20 -4
- package/package.json +2 -1
- package/scripts/dev-run.sh +139 -0
- package/src/commands/_lib/status/messages.ts +2 -1
- package/src/commands/_lib/status/meta.ts +5 -4
- package/src/crews/.orkeon/orkeon.d.ts +1 -1
- package/src/crews/_probe-shared-memory/probe.ork.ts +3 -3
- package/src/crews/advisor/crew.ork.ts +1 -1
- package/src/crews/agent-run/crew.ork.ts +1 -1
- package/src/crews/code-review/crew.ork.ts +1 -1
- package/src/crews/dev-batches/crew.ork.ts +1 -1
- package/src/crews/dev-change/domain/change-render.ts +1 -1
- package/src/crews/dev-learn/application/messages.ts +5 -0
- package/src/crews/dev-learn/application/prompts.ts +13 -16
- package/src/crews/dev-learn/application/run-dev-learn.ts +15 -12
- package/src/crews/dev-learn/crew.ork.ts +1 -1
- package/src/crews/dev-learn/domain/learn-answer.ts +38 -13
- package/src/crews/dev-learn/domain/markers.ts +10 -0
- package/src/crews/dev-learn/domain/messages.ts +13 -4
- package/src/crews/dev-plan/crew.ork.ts +1 -1
- package/src/crews/dev-plan/domain/plan-render.ts +3 -3
- package/src/crews/dev-spec/domain/spec-render.ts +3 -3
- package/src/crews/dev-verify/crew.ork.ts +1 -1
- package/src/crews/git-commit/application/draft.ts +22 -18
- package/src/crews/git-commit/application/messages.ts +2 -0
- package/src/crews/git-commit/application/run-git-commit.ts +4 -2
- package/src/crews/git-commit/crew.ork.ts +1 -1
- package/src/crews/init-verifiers/crew.ork.ts +1 -1
- package/src/crews/main-loop/application/run-main-loop.ts +1 -1
- package/src/crews/project-init/crew.ork.ts +1 -1
- package/src/crews/session-compact/crew.ork.ts +1 -1
- package/src/crews/shared-memory-admit/crew.ork.ts +1 -1
- package/src/shared/application/dev/messages.ts +3 -0
- package/src/shared/application/dev/preflight.ts +9 -4
- package/src/shared/domain/dev/learn-proposals.ts +48 -10
- package/src/shared/domain/dev/markers.ts +20 -0
- package/src/shared/domain/dev/messages.ts +12 -0
- package/src/shared/domain/dev/plan-format.ts +1 -1
- package/src/shared/domain/dev/work-folder.ts +2 -1
- package/src/shared/domain/git/close.ts +10 -8
- package/src/shared/domain/git/messages.ts +21 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Chain the steps of a dev crew headless, one fresh `orkeon run` process per step, until the
|
|
3
|
+
# work code's event log says the batches are closed, a human must decide, or nothing moved.
|
|
4
|
+
#
|
|
5
|
+
# bash scripts/dev-run.sh <crew> <code> --inputs '<json>' [--log <file>] [--max-steps N] [--wait S] [--retries N]
|
|
6
|
+
# ORKEON_CODE_WORKSPACE=~/src/app bash scripts/dev-run.sh dev-verify demo --inputs '{"batch":"F2","plan":"demo"}' \
|
|
7
|
+
# --log workbench/demo/DEMO-BATCHES-STATE.md
|
|
8
|
+
#
|
|
9
|
+
# Each step runs `orkeon-code run <crew> --workspace <project> --inputs <json>`;
|
|
10
|
+
# the inputs are the crew's own (its crew.ork.ts header names them), required. A crew run
|
|
11
|
+
# this way gets none of what its command does first: /dev-verify's check that the gate is
|
|
12
|
+
# on and its rule sets are not applied. The launcher passes the settings, the model and the
|
|
13
|
+
# mounts, as for the REPL (ORKEON_CODE_SETTINGS, ORKEON_CODE_MODEL; ORKEON_CODE_MODE=source with
|
|
14
|
+
# ORKEON_SOURCE runs the tool from an Orkeon checkout). DEV_RUN_RUNNER names another
|
|
15
|
+
# command, given the crew and --inputs alone (a fake in the tests): it passes its own `-s` and
|
|
16
|
+
# `-m`, or the crew runs on no settings and no mount. A step's output goes to <project>/.orkeon/dev/<code>/runs/<crew>-<n>.log, never
|
|
17
|
+
# whole to the terminal: its last line is shown. <project> is ORKEON_CODE_WORKSPACE, else
|
|
18
|
+
# the working directory. After each step:
|
|
19
|
+
# exit 130 (cancelled) or 1 (script error) -> stop with that code
|
|
20
|
+
# exit 75 (a question kept by checkpointing) -> exit 3 (a human answers it: orkeon run --resume)
|
|
21
|
+
# exit 2 with a rate limit in the log -> wait --wait seconds (default 60) and
|
|
22
|
+
# run it again, --retries times (default 2);
|
|
23
|
+
# then stop with 2
|
|
24
|
+
# exit 2 otherwise -> stop with 2
|
|
25
|
+
# exit 0 -> the last line of the event log, .orkeon/dev/<code>/batches-state.md, or the
|
|
26
|
+
# file --log names (relative to the project). /dev-batches writes Code's own log; a
|
|
27
|
+
# step that drives one batch alone (/dev-implement) does not: name a log it moves.
|
|
28
|
+
# `closed` (the line `- <date> <time> closed`, a trailing blank or CR aside) -> exit 0; an event whose
|
|
29
|
+
# detail starts with BLOCKED or GAPS -> exit 3 (a human decides);
|
|
30
|
+
# the same line as before the step -> exit 4 (no progress: never loop); else the next step.
|
|
31
|
+
# --max-steps (default 10) reached -> exit 5. Usage errors -> exit 64; the crew dev-batches is refused (64): a run
|
|
32
|
+
# of a whole plan without anyone at the keyboard stays the REPL's /dev-batches (docs/headless.md).
|
|
33
|
+
# Without DEV_RUN_RUNNER the project's trust is checked once, before the first step, where a terminal can answer:
|
|
34
|
+
# declined -> exit 0, nothing run; refused (no terminal) -> exit 2. Each step then runs with no stdin, so
|
|
35
|
+
# nothing it asks can hang the chain.
|
|
36
|
+
set -euo pipefail
|
|
37
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
38
|
+
|
|
39
|
+
usage() { echo "usage: scripts/dev-run.sh <crew> <code> --inputs '<json>' [--log <file>] [--max-steps N] [--wait S] [--retries N]" >&2; exit 64; }
|
|
40
|
+
[ $# -ge 2 ] || usage
|
|
41
|
+
crew="$1"; code="$2"; shift 2
|
|
42
|
+
case "$crew" in ''|*[!a-z0-9-]*) echo "dev-run: '$crew' is not a crew name" >&2; exit 64 ;; esac
|
|
43
|
+
case "$code" in ''|.*|*[!A-Za-z0-9._-]*) echo "dev-run: '$code' is not a work code" >&2; exit 64 ;; esac
|
|
44
|
+
if [ "$crew" = dev-batches ]; then
|
|
45
|
+
echo "dev-run: the crew dev-batches only names the next batch and logs it launched: a run of a whole plan without" \
|
|
46
|
+
"anyone at the keyboard stays the REPL's /dev-batches" >&2
|
|
47
|
+
exit 64
|
|
48
|
+
fi
|
|
49
|
+
inputs=""; log_file=""; max_steps=10; wait_s=60; retries=2
|
|
50
|
+
number() { case "$2" in ''|*[!0-9]*) echo "dev-run: $1 takes a whole number, not '$2'" >&2; exit 64 ;; esac; }
|
|
51
|
+
while [ $# -gt 0 ]; do
|
|
52
|
+
case "$1" in
|
|
53
|
+
--inputs) [ $# -ge 2 ] || usage; inputs="$2"; shift 2 ;;
|
|
54
|
+
--log) [ $# -ge 2 ] || usage; log_file="$2"; shift 2 ;;
|
|
55
|
+
--max-steps) [ $# -ge 2 ] || usage; number "$1" "$2"; max_steps="$2"; shift 2 ;;
|
|
56
|
+
--wait) [ $# -ge 2 ] || usage; number "$1" "$2"; wait_s="$2"; shift 2 ;;
|
|
57
|
+
--retries) [ $# -ge 2 ] || usage; number "$1" "$2"; retries="$2"; shift 2 ;;
|
|
58
|
+
*) usage ;;
|
|
59
|
+
esac
|
|
60
|
+
done
|
|
61
|
+
[ -n "$inputs" ] || { echo "dev-run: --inputs is required: the crew's own inputs (its crew.ork.ts header names them)" >&2; exit 64; }
|
|
62
|
+
[ "$max_steps" -ge 1 ] || { echo "dev-run: --max-steps must be 1 or more" >&2; exit 64; }
|
|
63
|
+
|
|
64
|
+
project="$(cd "${ORKEON_CODE_WORKSPACE:-.}" && pwd)"
|
|
65
|
+
export ORKEON_CODE_WORKSPACE="$project"
|
|
66
|
+
case "$log_file" in /*|*..*) echo "dev-run: --log is a path inside the project, not '$log_file'" >&2; exit 64 ;; esac
|
|
67
|
+
state="$project/${log_file:-.orkeon/dev/$code/batches-state.md}"
|
|
68
|
+
runs="$project/.orkeon/dev/$code/runs"
|
|
69
|
+
crew_file="$ROOT/src/crews/$crew/crew.ork.ts"
|
|
70
|
+
[ -f "$crew_file" ] || { echo "dev-run: no crew '$crew' ($crew_file)" >&2; exit 64; }
|
|
71
|
+
|
|
72
|
+
# The last line not blank, without its CR or trailing blanks (a log edited on Windows).
|
|
73
|
+
last_line() { [ -f "$state" ] && tr -d '\r' <"$state" | sed 's/[[:space:]]*$//' | grep -v '^$' | tail -n 1 || true; }
|
|
74
|
+
next_log() {
|
|
75
|
+
local n=1
|
|
76
|
+
while [ -e "$runs/$crew-$n.log" ]; do n=$((n + 1)); done
|
|
77
|
+
echo "$runs/$crew-$n.log"
|
|
78
|
+
}
|
|
79
|
+
run_once() {
|
|
80
|
+
local log="$1" rc=0
|
|
81
|
+
if [ -n "${DEV_RUN_RUNNER:-}" ]; then
|
|
82
|
+
$DEV_RUN_RUNNER "$crew_file" --inputs "$inputs" </dev/null >"$log" 2>&1 || rc=$?
|
|
83
|
+
else
|
|
84
|
+
bash "$ROOT/orkeon-code" run "$crew_file" --workspace "$project" --inputs "$inputs" </dev/null >"$log" 2>&1 || rc=$?
|
|
85
|
+
fi
|
|
86
|
+
return "$rc"
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
# The trust question asked here, once, with the terminal: in a step it would land in the step's log.
|
|
90
|
+
if [ -z "${DEV_RUN_RUNNER:-}" ]; then
|
|
91
|
+
rc=0; bash "$ROOT/orkeon-code" trust check "$project" || rc=$?
|
|
92
|
+
case "$rc" in
|
|
93
|
+
0) ;;
|
|
94
|
+
4) echo "dev-run: $project is not trusted: nothing run"; exit 0 ;;
|
|
95
|
+
*) echo "dev-run: trust $project first (orkeon-code trust add $project), then run this again" >&2; exit 2 ;;
|
|
96
|
+
esac
|
|
97
|
+
fi
|
|
98
|
+
# Nothing is created in the project before its trust is known.
|
|
99
|
+
mkdir -p "$runs"
|
|
100
|
+
|
|
101
|
+
step=0
|
|
102
|
+
while [ "$step" -lt "$max_steps" ]; do
|
|
103
|
+
step=$((step + 1))
|
|
104
|
+
before="$(last_line)"
|
|
105
|
+
attempt=0
|
|
106
|
+
while :; do
|
|
107
|
+
log="$(next_log)"
|
|
108
|
+
rc=0; run_once "$log" || rc=$?
|
|
109
|
+
echo "dev-run: step $step of $crew ($code): exit $rc, log ${log#"$project"/}"
|
|
110
|
+
tail -n 1 "$log" 2>/dev/null | sed 's/^/ last line: /' || true
|
|
111
|
+
# A 429 inside a run is first the runtime's: Llm:MaxRetries, then the profile's Fallback chain (Orkeon #299) when
|
|
112
|
+
# the settings name one. This loop is the whole-process retry, for a step the runtime gave up on.
|
|
113
|
+
if [ "$rc" = 2 ] && grep -qiE 'HTTP[ /0-9.]* 429|status( code)?[ :=]*429|too many requests|rate.?limit|LlmRateLimitException' "$log" && [ "$attempt" -lt "$retries" ]; then
|
|
114
|
+
attempt=$((attempt + 1))
|
|
115
|
+
echo "dev-run: rate limited; waiting ${wait_s}s before attempt $((attempt + 1))"
|
|
116
|
+
sleep "$wait_s"
|
|
117
|
+
continue
|
|
118
|
+
fi
|
|
119
|
+
break
|
|
120
|
+
done
|
|
121
|
+
case "$rc" in
|
|
122
|
+
0) ;;
|
|
123
|
+
130) echo "dev-run: cancelled"; exit 130 ;;
|
|
124
|
+
1) echo "dev-run: the crew failed (script error): see the log"; exit 1 ;;
|
|
125
|
+
75) echo "dev-run: the step stopped on a question kept by checkpointing (exit 75): a human answers it (orkeon run --resume), see the log"; exit 3 ;;
|
|
126
|
+
*) echo "dev-run: the run failed (exit $rc): see the log"; exit 2 ;;
|
|
127
|
+
esac
|
|
128
|
+
after="$(last_line)"
|
|
129
|
+
if printf '%s\n' "$after" | grep -qE '^- [0-9-]+ [0-9:]+ closed$'; then echo "dev-run: closed"; exit 0; fi
|
|
130
|
+
if printf '%s\n' "$after" | grep -qE '^- [0-9-]+ [0-9:]+ F[0-9]+ [a-z]+ (BLOCKED|GAPS)([^A-Za-z]|$)'; then
|
|
131
|
+
echo "dev-run: a human decides: $after"; exit 3
|
|
132
|
+
fi
|
|
133
|
+
if [ "$after" = "$before" ]; then
|
|
134
|
+
echo "dev-run: no progress (the last line of ${state#"$project"/} did not change): stopped"
|
|
135
|
+
exit 4
|
|
136
|
+
fi
|
|
137
|
+
done
|
|
138
|
+
echo "dev-run: $max_steps step(s) reached: stopped"
|
|
139
|
+
exit 5
|
|
@@ -78,7 +78,7 @@ export const noToolCallHolds = (text: string): string => `no tool call holds '${
|
|
|
78
78
|
export const RELEASE_NOTES = [
|
|
79
79
|
`${CLI_NAME} ${CLI_VERSION} (${CLI_BUILD})`,
|
|
80
80
|
"",
|
|
81
|
-
`
|
|
81
|
+
`Third release candidate of 1.0.0, on Orkeon 1.3.0 (main ${ORKEON_RUNTIME_PIN}).`,
|
|
82
82
|
"",
|
|
83
83
|
"Crews: main-loop (the interactive loop behind /assistant), code-review, git-commit,",
|
|
84
84
|
" project-init, init-verifiers, session-compact, advisor, analyze, speech,",
|
|
@@ -96,5 +96,6 @@ export const RELEASE_NOTES = [
|
|
|
96
96
|
" /effort sets the reasoning effort among the levels the model takes.",
|
|
97
97
|
"Decision model (off by default): /route runs a crew on the cheapest profile that fits,",
|
|
98
98
|
" /skills suggest offers the skills that fit a turn, compaction.prune drops stale tool results.",
|
|
99
|
+
"Headless: orkeon-code run <crew> runs one crew from a shell, its result alone on stdout.",
|
|
99
100
|
"Code intelligence: index, maps, dependency graph and symbol tools of the Orkeon runtime.",
|
|
100
101
|
].join("\n");
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Orkeon Code versions independently of the Orkeon runtime it runs on: the
|
|
4
4
|
// runtime is pinned to a commit of Orkeon's main in .orkeon-version, this one follows
|
|
5
|
-
// package.json (tests/repository/version.test.ts keeps the two equal).
|
|
6
|
-
//
|
|
5
|
+
// package.json (tests/repository/version.test.ts keeps the two equal). In RELEASE_NOTES (messages.ts),
|
|
6
|
+
// tests/commands/_lib/status/messages.test.ts pins the command count, this version, the crew names, the Orkeon
|
|
7
|
+
// version of .config/dotnet-tools.json and the Headless line; the rest of the notes no test checks.
|
|
7
8
|
|
|
8
9
|
export const CLI_NAME = "orkeon-code";
|
|
9
|
-
export const CLI_VERSION = "1.0.0-rc.
|
|
10
|
+
export const CLI_VERSION = "1.0.0-rc.3";
|
|
10
11
|
export const CLI_BUILD = "source";
|
|
11
12
|
/** The Orkeon runtime this version runs on: the commit of Orkeon's `main` pinned in .orkeon-version, which the
|
|
12
13
|
* launcher announces (tests/repository/version.test.ts keeps the two equal). A release tag is never the pin: the
|
|
13
14
|
* commands are checked against the sources at this commit (ADR 0013). /status and /doctor compare it with the
|
|
14
15
|
* commit of the runtime that runs them, read from the host's `runtime` service (Orkeon #225). */
|
|
15
|
-
export const ORKEON_RUNTIME_COMMIT = "
|
|
16
|
+
export const ORKEON_RUNTIME_COMMIT = "d81bfab393ce1f9235ed2711dd770b87398b4345";
|
|
16
17
|
/** The pin as the launcher and the rows print it: its first seven characters. */
|
|
17
18
|
export const ORKEON_RUNTIME_PIN = ORKEON_RUNTIME_COMMIT.slice(0, 7);
|
|
18
19
|
|
|
@@ -3886,7 +3886,7 @@ declare global {
|
|
|
3886
3886
|
/** Force a full reindex of the collection (required after an embedding model change) */
|
|
3887
3887
|
reindex?: boolean;
|
|
3888
3888
|
/** File paths, glob patterns or http(s) addresses to ingest (e.g. '/workspace/docs/**\/*.md') */
|
|
3889
|
-
sources: readonly
|
|
3889
|
+
sources: readonly string[];
|
|
3890
3890
|
}, ctx?: ExecutionContext): Promise<unknown>;
|
|
3891
3891
|
|
|
3892
3892
|
/** `rag_search` - What do the ingested documents say about this? Searches the knowledge collections rag_ingest filled (documents, pages, notes) and returns an answer grounded in the top_k most relevant chunks (3), with their citations. For the code of the workspace, codebase_search, grep and file_read; rag_search knows only what was ingested. */
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
// 3. runs the repository's own recallEntries on the same collection for q08 (the superseded id is
|
|
13
13
|
// never kept) and q13 (buildPrecedentsBlock renders no block);
|
|
14
14
|
// 4. prints a PASS/FAIL table and a last line `shared-memory probe: PASS|FAIL`.
|
|
15
|
-
// rag_eval declares an edit (Orkeon #223: it re-ingests the corpus and writes its reports),
|
|
16
|
-
//
|
|
17
|
-
//
|
|
15
|
+
// rag_eval declares an edit (Orkeon #223: it re-ingests the corpus and writes its reports), but the body calls it
|
|
16
|
+
// from code, not through an act: the permission gate judges only an act's tool calls, so the call runs in every
|
|
17
|
+
// mode and nothing is asked. q13 holds only when the run's settings set a retrieval score floor
|
|
18
18
|
// (Orkeon:Rag:Retrieval:MinScore; none by default, then every query returns passages).
|
|
19
19
|
//
|
|
20
20
|
// Run: bash scripts/check-shared-memory.sh
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// A one-shot second opinion on the session's last exchange, from a DIFFERENT model.
|
|
6
6
|
//
|
|
7
7
|
// Input (globalThis.inputs): {} — the subject is the session buffer.
|
|
8
|
-
// Run standalone:
|
|
8
|
+
// Run standalone: ./orkeon-code run advisor
|
|
9
9
|
//
|
|
10
10
|
// No tools: an advisor reads the exchange and judges it. Handing it file or shell
|
|
11
11
|
// access would let it go re-verify the work, which is a different (and much more
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// memoryRecall?: false (a session rule denies it), step?: the instance's run step }
|
|
13
13
|
// (the step: the instance's run's - dev-plan, dev-verify, dev-spec, dev-change -, else the charter's)
|
|
14
14
|
// Budget: repairBudget(step), the step's own, so that a repaired audit or review stops where the original would.
|
|
15
|
-
// Run standalone:
|
|
15
|
+
// Run standalone: ./orkeon-code run agent-run --inputs '{"charter":"dev-reviewer","brief":"…"}'
|
|
16
16
|
|
|
17
17
|
import { CrewBuilder, publishCrew, inputs, ToolBuilder } from "../../shared/infrastructure/globals.ts";
|
|
18
18
|
import {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// commit — review that commit instead of the staged changes
|
|
12
12
|
// lenses — the lenses of this run, outranking review.lenses (/review --lens, /security-review)
|
|
13
13
|
// passes — the rounds of this run, outranking the session's /passes (/review --passes)
|
|
14
|
-
// Run standalone:
|
|
14
|
+
// Run standalone: ./orkeon-code run code-review
|
|
15
15
|
|
|
16
16
|
import { CrewBuilder, publishCrew, inputs } from "../../shared/infrastructure/globals.ts";
|
|
17
17
|
import {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// permissionMode?, permissionRules?, githubTool?, hooks?, effort?, memoryRecall? }
|
|
18
18
|
// Answer: JSON { lines: string[], next?: { crew: "dev-implement" | "dev-batches", input } }, read by the command's
|
|
19
19
|
// completed: dev-implement for the next batch of a sequential run, dev-batches for a parallel run's next wave.
|
|
20
|
-
// Run standalone:
|
|
20
|
+
// Run standalone: ./orkeon-code run dev-batches --inputs '{"code":"prune"}'
|
|
21
21
|
// (it logs the batch it names as launched and launches nothing: drive that batch with dev-implement)
|
|
22
22
|
//
|
|
23
23
|
// Budget: domain/batches-budget.ts (the driver's, and each batch agent's run: L8P-D12, Orkeon/orkeon#189).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The change brief as code writes it: the
|
|
1
|
+
// The change brief as code writes it: the eight sections of CHANGE_SECTIONS with a section 9 of decisions, an
|
|
2
2
|
// empty section left out. § 1 (the origin, quoted) and the facts of § 2 (the reproduction or the measurement that
|
|
3
3
|
// ran) are code's and carried over from the file on a revision or a fold; the model adds its own facts after them.
|
|
4
4
|
// A criterion carries a `- **Statement**:` line first, which spec-format.ts reads for /dev-plan. Pure, no IO.
|
|
@@ -31,6 +31,11 @@ export const AXIS_TABLE_HEADER = "axis gaps batches blocking";
|
|
|
31
31
|
export const REFUSED_IN_HARNESS = "refused in the harness's state";
|
|
32
32
|
export const REMOVED_LINE_KEPT = "its removed line is kept (harness refusal)";
|
|
33
33
|
|
|
34
|
+
// ── The reconcile summary of a motif ────────────────────────────────────
|
|
35
|
+
|
|
36
|
+
export const ownerAbsent = (path: string): string => `owner absent: ${path}`;
|
|
37
|
+
export const orkeonCodeOwnerNotRead = (path: string): string => `Orkeon Code owner, not read here: ${path}`;
|
|
38
|
+
|
|
34
39
|
// ── The end message ─────────────────────────────────────────────────────
|
|
35
40
|
|
|
36
41
|
export const axisUnchanged = (axis: string, since: string | undefined): string =>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// The learner's prompt for one axis (ADR 0003): the instructions, the material - the
|
|
2
2
|
// axis, its untreated rows as a table, the refused motifs, the repository's guidance
|
|
3
|
-
// files and the harness
|
|
3
|
+
// files, Orkeon Code's destinations and the harness's - the problems of a refused answer and the owner
|
|
4
4
|
// lines code found for them. Text only: ./learn-prompt-fit.ts fits it under its budget.
|
|
5
5
|
import { MAX_LINES_PER_MOTIF, MAX_TOPIC_CHARS } from "../domain/learn-answer.ts";
|
|
6
6
|
import type { OwnerLinesBlock } from "../domain/owner-lines.ts";
|
|
7
|
+
import { HARNESS_DESTINATIONS, ORKEON_CODE_DESTINATIONS } from "../domain/markers.ts";
|
|
7
8
|
|
|
8
9
|
export const LEARN_INSTRUCTIONS: string = [
|
|
9
10
|
"You study the gaps that audits of finished batches keep finding on one axis, and propose what would stop them " +
|
|
@@ -26,11 +27,13 @@ export const LEARN_INSTRUCTIONS: string = [
|
|
|
26
27
|
"- Where a rule can be written as code, prefer the check: a test, an analyzer rule, an architecture test or the " +
|
|
27
28
|
"gate. Name it in check; rule means a written rule only.",
|
|
28
29
|
"- Pick the owner closest to where the gap was made. A rule of the repository comes first (its contributing " +
|
|
29
|
-
"guide, a lint or analyzer rule, an architecture test, its repository pack), taken from the owner files listed
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
30
|
+
"guide, a lint or analyzer rule, an architecture test, its repository pack), taken from the owner files listed " +
|
|
31
|
+
"or, for a rule of its pack in the harness, from the harness destinations. Name an Orkeon Code file only when " +
|
|
32
|
+
"the workflow itself writes or audits the wrong thing, and only one of its destinations listed.",
|
|
33
|
+
"- Bear in mind that nothing here changes an Orkeon Code file or a harness file. For one, give its path as its " +
|
|
34
|
+
"destinations list it, with the lines to take out and the lines to put in; the user receives them as a patch " +
|
|
35
|
+
"for the orkeon-code or the orkeon-workshop repository. A path under .claude/ is a deployed copy and never an " +
|
|
36
|
+
"owner. An Orkeon Code owner is never read here, so its motif always takes status new and removes no line.",
|
|
34
37
|
"- Statuses refines, replaces and removes are only for an answer shown owner lines below its problems: copy each " +
|
|
35
38
|
"removed line character for character from a shown line, and say in novelty what the shown lines miss. removes " +
|
|
36
39
|
"takes out a line the rows show to be wrong and adds none.",
|
|
@@ -52,15 +55,6 @@ export interface LearnMaterial {
|
|
|
52
55
|
owners: readonly string[];
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
/** Where a harness owner may live, in the orkeon-workshop repository. */
|
|
56
|
-
const HARNESS_DESTINATIONS: readonly string[] = [
|
|
57
|
-
".devcontainer/harness/packs/dev/claude/skills/dev-plan/references/plan-template.md",
|
|
58
|
-
".devcontainer/harness/packs/dev/claude/skills/dev-implement/references/common-rules.md",
|
|
59
|
-
".devcontainer/harness/packs/dev/claude/skills/dev-verify/references/audit-axes.md",
|
|
60
|
-
".devcontainer/harness/packs/dev/claude/skills/dev-verify/scripts/audit-capture.sh",
|
|
61
|
-
".devcontainer/harness/packs/repo-<name>/claude/rules/<file>",
|
|
62
|
-
];
|
|
63
|
-
|
|
64
58
|
/** The head of the rows table: its columns, then its rule. */
|
|
65
59
|
export const ROWS_TABLE_HEAD: readonly string[] = [
|
|
66
60
|
"| id | batch | severity | gap | evidence | fix |",
|
|
@@ -90,7 +84,10 @@ export function learnHead(input: LearnMaterial, problems: readonly string[]): st
|
|
|
90
84
|
"Owner files of the repository:",
|
|
91
85
|
...listed(input.owners),
|
|
92
86
|
"",
|
|
93
|
-
"
|
|
87
|
+
"Orkeon Code destinations (owner_kind orkeon-code, paths in the orkeon-code repository):",
|
|
88
|
+
...listed(ORKEON_CODE_DESTINATIONS),
|
|
89
|
+
"",
|
|
90
|
+
"Harness destinations (owner_kind harness, paths in the orkeon-workshop repository):",
|
|
94
91
|
...listed(HARNESS_DESTINATIONS),
|
|
95
92
|
...(problems.length > 0
|
|
96
93
|
? ["", "Your previous answer had these problems; answer again, fixing each:", ...problems.map((p) => `- ${p}`)]
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "../../../shared/domain/dev/learn-proposals.ts";
|
|
29
29
|
import type { AxisProposal, DroppedMotif, Motif, ProposalsFile } from "../../../shared/domain/dev/learn-proposals.ts";
|
|
30
30
|
import { sha1Hex } from "../../../shared/domain/sha1.ts";
|
|
31
|
-
import { LEARN_ANSWER_SCHEMA, checkLearnAnswer, motifLabel } from "../domain/learn-answer.ts";
|
|
31
|
+
import { LEARN_ANSWER_SCHEMA, checkForOwnerReview, checkLearnAnswer, motifLabel } from "../domain/learn-answer.ts";
|
|
32
32
|
import type { AnswerMotif, LearnAnswer } from "../domain/learn-answer.ts";
|
|
33
33
|
import { matchOwner, reviewOwner } from "../domain/owner-lines.ts";
|
|
34
34
|
import type { OwnerLinesBlock, OwnerReview } from "../domain/owner-lines.ts";
|
|
@@ -37,7 +37,7 @@ import { MAX_LEARN_PROMPT_CHARS, buildLearnPrompt } from "./learn-prompt-fit.ts"
|
|
|
37
37
|
import type { LearnPromptInput } from "./learn-prompt-fit.ts";
|
|
38
38
|
import { readBacklog } from "./learn-backlog.ts";
|
|
39
39
|
import type { Backlog } from "./learn-backlog.ts";
|
|
40
|
-
import { AXIS_TABLE_HEADER, BAD_INPUT_AXIS, BAD_INPUT_LIST, NOTHING_TO_DECIDE_UNTIL_NEW_GAPS, NOTHING_UNTREATED, LEARN_NOT_IN_WORK_TREE, REFUSED_IN_HARNESS, REFUSE_EACH, REMOVED_LINE_KEPT, axisUnchanged, decideQuestion, learnHead, motifsProposed, noAxisEligible, noMotifKept, noProposalOnAxis, notAtTop, nothingUntreatedOnAxis, proposalsWritten, underThreeBatches } from "./messages.ts";
|
|
40
|
+
import { AXIS_TABLE_HEADER, BAD_INPUT_AXIS, BAD_INPUT_LIST, NOTHING_TO_DECIDE_UNTIL_NEW_GAPS, NOTHING_UNTREATED, LEARN_NOT_IN_WORK_TREE, REFUSED_IN_HARNESS, REFUSE_EACH, REMOVED_LINE_KEPT, axisUnchanged, decideQuestion, learnHead, motifsProposed, noAxisEligible, noMotifKept, noProposalOnAxis, notAtTop, nothingUntreatedOnAxis, orkeonCodeOwnerNotRead, ownerAbsent, proposalsWritten, underThreeBatches } from "./messages.ts";
|
|
41
41
|
import { answerDidNotParse } from "../../../shared/application/agents/messages.ts";
|
|
42
42
|
import { errorText } from "../../../shared/domain/error-text.ts";
|
|
43
43
|
import {
|
|
@@ -247,9 +247,9 @@ function unchangedSince(previous: ProposalsFile | null, axis: string, shown: rea
|
|
|
247
247
|
/** What the owner files say against a checked answer: the problems of a re-ask and the owner lines shown with them. */
|
|
248
248
|
interface OwnerFindings { problems: string[]; blocks: OwnerLinesBlock[] }
|
|
249
249
|
|
|
250
|
-
/** Two attempts. A first answer refused on shape spends the second on its problems, as before; when its only
|
|
251
|
-
*
|
|
252
|
-
* lines of its motifs. A first answer that passes is reviewed against its owners; when they raise problems, the
|
|
250
|
+
/** Two attempts. A first answer refused on shape spends the second on its problems, as before; when its only faults
|
|
251
|
+
* are a status other than new given before any owner line was shown, or the status or removed lines of an Orkeon
|
|
252
|
+
* Code motif, the second attempt also shows the owner lines of its motifs. A first answer that passes is reviewed against its owners; when they raise problems, the
|
|
253
253
|
* second attempt shows them with the owner lines, and a second answer that fails its check leaves the first one
|
|
254
254
|
* standing. */
|
|
255
255
|
async function ask(
|
|
@@ -272,7 +272,7 @@ async function ask(
|
|
|
272
272
|
if (!checked.ok) {
|
|
273
273
|
if (first !== null) return { ok: true, answer: first };
|
|
274
274
|
problems = checked.problems;
|
|
275
|
-
const seen = attempt === 0 ?
|
|
275
|
+
const seen = attempt === 0 ? checkForOwnerReview(value, shownIds) : null;
|
|
276
276
|
if (seen?.ok) {
|
|
277
277
|
const findings = await review(seen.value);
|
|
278
278
|
problems = [...problems, ...findings.problems];
|
|
@@ -330,12 +330,13 @@ function filterMotifs(
|
|
|
330
330
|
|
|
331
331
|
// ---- reconcile ----
|
|
332
332
|
|
|
333
|
-
/** Reads a motif's owner file in the checkout (a harness owner through its deployed copy
|
|
334
|
-
* path: the file read. */
|
|
333
|
+
/** Reads a motif's owner file in the checkout (a harness owner through its deployed copy; an Orkeon Code owner is
|
|
334
|
+
* not a file of the checkout, so never read), each path once a run; path: the file read. */
|
|
335
335
|
function ownerReader(files: Pick<Files, "read">): (motif: AnswerMotif) => Promise<{ path: string; text: string | null }> {
|
|
336
336
|
const texts = new Map<string, string | null>();
|
|
337
337
|
return async (motif) => {
|
|
338
|
-
const path = motif.owner.kind === "harness" ? deployedHarnessPath(motif.owner.path)
|
|
338
|
+
const path = motif.owner.kind === "harness" ? deployedHarnessPath(motif.owner.path)
|
|
339
|
+
: motif.owner.kind === "orkeon-code" ? null : motif.owner.path;
|
|
339
340
|
if (path === null) return { path: motif.owner.path, text: null };
|
|
340
341
|
if (!texts.has(path)) {
|
|
341
342
|
let text: string | null;
|
|
@@ -352,11 +353,13 @@ function ownerReader(files: Pick<Files, "read">): (motif: AnswerMotif) => Promis
|
|
|
352
353
|
|
|
353
354
|
type OwnerRead = ReturnType<typeof ownerReader>;
|
|
354
355
|
|
|
355
|
-
/** A kept motif against its owner: an
|
|
356
|
-
* holds is named under the owner's own path, a harness owner's in the
|
|
356
|
+
/** A kept motif against its owner: an Orkeon Code owner, never read, and an absent owner (the file read) are only
|
|
357
|
+
* said in the summary; what the owner holds is named under the owner's own path, a harness owner's in the
|
|
358
|
+
* orkeon-workshop repository. */
|
|
357
359
|
async function reconcile(read: OwnerRead, { motif, k }: Kept): Promise<OwnerReview> {
|
|
358
360
|
const { path, text } = await read(motif);
|
|
359
|
-
if (
|
|
361
|
+
if (motif.owner.kind === "orkeon-code") return { summary: orkeonCodeOwnerNotRead(path), problems: [], block: null };
|
|
362
|
+
if (text === null) return { summary: ownerAbsent(path), problems: [], block: null };
|
|
360
363
|
return reviewOwner(motifLabel(k, motif.title), motif, motif.owner.path, matchOwner(text, motif.keyTerm, motif.linesRemoved));
|
|
361
364
|
}
|
|
362
365
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// the backlog per axis: no model call, no question, no write.
|
|
13
13
|
//
|
|
14
14
|
// Input (globalThis.inputs): { axis?: string | null, list?: boolean }
|
|
15
|
-
// Run standalone:
|
|
15
|
+
// Run standalone: ./orkeon-code run dev-learn --inputs '{"list":true}'
|
|
16
16
|
//
|
|
17
17
|
// No tool callbacks (shared/application/dev/tool-callbacks.ts): the learner has no tool and makes no act
|
|
18
18
|
// call, so there is no tool call to guard; the question goes through the human_input port (orkeonHumanInput),
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
// of what is wrong with it, so the crew can ask once more. Pure, no IO.
|
|
4
4
|
import type { Checked } from "../../../shared/domain/agents/charter.ts";
|
|
5
5
|
import type { CheckKind, MotifStatus, OwnerKind } from "../../../shared/domain/dev/learn-proposals.ts";
|
|
6
|
+
import { isHarnessRule } from "../../../shared/domain/dev/learn-proposals.ts";
|
|
6
7
|
import { MAX_TOPIC_CHARS, TOPIC_PATTERN } from "../../../shared/domain/shared-memory/refused.ts";
|
|
7
|
-
import { MOTIFS_MUST_BE_LIST, SEEN_LINES_ONLY, addsLines, atProblem, checkIsOneOf, deployedCopy, droppedNeeds, harnessOwnerUnder, lineLength, needsRemovedLine, ownerKindIs, ownerPathNotRelative, removesLines, rowNotGiven, rowTwice, rowsEmpty, sameRows, statusIs, titleLength, tooManyMotifs, topicNotSlug } from "./messages.ts";
|
|
8
|
+
import { MOTIFS_MUST_BE_LIST, SEEN_LINES_ONLY, addsLines, atProblem, checkIsOneOf, deployedCopy, droppedNeeds, harnessOwnerUnder, orkeonCodeNewOnly, orkeonCodeOwnerListed, orkeonCodeRemovesNothing, lineLength, needsRemovedLine, ownerKindIs, ownerPathNotRelative, removesLines, rowNotGiven, rowTwice, rowsEmpty, sameRows, statusIs, titleLength, tooManyMotifs, topicNotSlug } from "./messages.ts";
|
|
9
|
+
import { HARNESS_DESTINATIONS, ORKEON_CODE_DESTINATIONS } from "./markers.ts";
|
|
8
10
|
import { ANSWER_NOT_AN_OBJECT as NOT_AN_OBJECT, fieldEmpty } from "../../../shared/domain/dev/messages.ts";
|
|
9
11
|
|
|
10
12
|
export { MAX_TOPIC_CHARS };
|
|
@@ -26,11 +28,10 @@ export interface AnswerMotif {
|
|
|
26
28
|
export interface AnswerDropped { title: string; filter: "recurrence" | "prevention" | "novelty"; reason: string }
|
|
27
29
|
export interface LearnAnswer { motifs: AnswerMotif[]; dropped: AnswerDropped[] }
|
|
28
30
|
|
|
29
|
-
const OWNER_KINDS: readonly OwnerKind[] = ["repository", "harness"];
|
|
31
|
+
const OWNER_KINDS: readonly OwnerKind[] = ["repository", "orkeon-code", "harness"];
|
|
30
32
|
const CHECK_KINDS: readonly CheckKind[] = ["test", "analyzer", "architecture-test", "gate", "rule"];
|
|
31
33
|
const STATUSES: readonly MotifStatus[] = ["new", "refines", "replaces", "removes"];
|
|
32
34
|
const FILTERS: ReadonlyArray<AnswerDropped["filter"]> = ["recurrence", "prevention", "novelty"];
|
|
33
|
-
const HARNESS_PACKS = ".devcontainer/harness/packs/";
|
|
34
35
|
|
|
35
36
|
const stringList = { type: "array", items: { type: "string" } };
|
|
36
37
|
|
|
@@ -113,8 +114,12 @@ function isRelativePath(raw: unknown): boolean {
|
|
|
113
114
|
return !p.split("/").includes("..");
|
|
114
115
|
}
|
|
115
116
|
|
|
117
|
+
/** What a check holds a motif to. ownerLinesShown: whether the prompt that gave the answer showed owner lines.
|
|
118
|
+
* orkeonCodeRules: whether an Orkeon Code motif's status and removed lines are checked. */
|
|
119
|
+
interface MotifRules { ownerLinesShown: boolean; orkeonCodeRules: boolean }
|
|
120
|
+
|
|
116
121
|
function checkMotif(
|
|
117
|
-
value: unknown, k: number, shownIds: ReadonlySet<string>,
|
|
122
|
+
value: unknown, k: number, shownIds: ReadonlySet<string>, rules: MotifRules, problems: string[],
|
|
118
123
|
): AnswerMotif | undefined {
|
|
119
124
|
const item = isPlainObject(value) ? value : {};
|
|
120
125
|
const before = problems.length;
|
|
@@ -148,18 +153,26 @@ function checkMotif(
|
|
|
148
153
|
problems.push(ownerPathNotRelative(at, path));
|
|
149
154
|
} else if (kind === "repository" && (path === ".claude" || path.startsWith(".claude/"))) {
|
|
150
155
|
problems.push(deployedCopy(at));
|
|
151
|
-
} else if (kind === "harness" && !path
|
|
152
|
-
problems.push(harnessOwnerUnder(at,
|
|
156
|
+
} else if (kind === "harness" && !isHarnessRule(path)) {
|
|
157
|
+
problems.push(harnessOwnerUnder(at, HARNESS_DESTINATIONS[0]));
|
|
158
|
+
} else if (kind === "orkeon-code" && !ORKEON_CODE_DESTINATIONS.includes(path)) {
|
|
159
|
+
problems.push(orkeonCodeOwnerListed(at, path));
|
|
153
160
|
}
|
|
154
161
|
|
|
155
162
|
const check = text(item.check) as CheckKind;
|
|
156
163
|
if (!CHECK_KINDS.includes(check)) problems.push(checkIsOneOf(at, CHECK_KINDS.join(", ")));
|
|
157
164
|
const status = text(item.status) as MotifStatus;
|
|
158
165
|
if (!STATUSES.includes(status)) problems.push(statusIs(at));
|
|
159
|
-
else if (status !== "new" &&
|
|
166
|
+
else if (status !== "new" && kind === "orkeon-code") {
|
|
167
|
+
if (rules.orkeonCodeRules) problems.push(orkeonCodeNewOnly(at, status));
|
|
168
|
+
} else if (status !== "new" && !rules.ownerLinesShown) problems.push(atProblem(at, SEEN_LINES_ONLY(status)));
|
|
160
169
|
|
|
161
170
|
const removed = lines(item.lines_removed);
|
|
162
171
|
const added = lines(item.lines_added);
|
|
172
|
+
// A new motif of an Orkeon Code owner takes out no line: none of that owner was ever shown, so one would be invented.
|
|
173
|
+
if (rules.orkeonCodeRules && status === "new" && kind === "orkeon-code" && (removed ?? []).some((l) => l !== "")) {
|
|
174
|
+
problems.push(orkeonCodeRemovesNothing(at));
|
|
175
|
+
}
|
|
163
176
|
const linesRule = status === "removes" ? REMOVES_LINES : ADDS_LINES;
|
|
164
177
|
if (added === null || removed === null || removed.length > MAX_LINES_PER_MOTIF) {
|
|
165
178
|
problems.push(`${at}: ${linesRule}`);
|
|
@@ -207,11 +220,7 @@ function checkDropped(value: unknown, problems: string[]): AnswerDropped[] {
|
|
|
207
220
|
return out;
|
|
208
221
|
}
|
|
209
222
|
|
|
210
|
-
|
|
211
|
-
* gave this answer showed owner lines; without them, a status other than new is a problem. */
|
|
212
|
-
export function checkLearnAnswer(
|
|
213
|
-
value: unknown, shownIds: ReadonlySet<string>, ownerLinesShown: boolean,
|
|
214
|
-
): Checked<LearnAnswer> {
|
|
223
|
+
function checkAnswer(value: unknown, shownIds: ReadonlySet<string>, rules: MotifRules): Checked<LearnAnswer> {
|
|
215
224
|
if (!isPlainObject(value)) return { ok: false, problems: [NOT_AN_OBJECT] };
|
|
216
225
|
if (!Array.isArray(value.motifs)) return { ok: false, problems: [MOTIFS_MUST_BE_LIST] };
|
|
217
226
|
const problems: string[] = [];
|
|
@@ -220,7 +229,7 @@ export function checkLearnAnswer(
|
|
|
220
229
|
// A motif's id hashes its axis and its rows: two motifs of one set of rows would share it, and one decision.
|
|
221
230
|
const rowSets = new Map<string, number>();
|
|
222
231
|
value.motifs.forEach((m, i) => {
|
|
223
|
-
const motif = checkMotif(m, i + 1, shownIds,
|
|
232
|
+
const motif = checkMotif(m, i + 1, shownIds, rules, problems);
|
|
224
233
|
if (!motif) return;
|
|
225
234
|
motifs.push(motif);
|
|
226
235
|
const key = [...motif.rows].sort().join(",");
|
|
@@ -231,3 +240,19 @@ export function checkLearnAnswer(
|
|
|
231
240
|
const dropped = checkDropped(value.dropped, problems);
|
|
232
241
|
return problems.length > 0 ? { ok: false, problems } : { ok: true, value: { motifs, dropped } };
|
|
233
242
|
}
|
|
243
|
+
|
|
244
|
+
/** shownIds: the ids handed to the model; an id outside them is a problem. ownerLinesShown: whether the prompt that
|
|
245
|
+
* gave this answer showed owner lines; without them, a status other than new is a problem. */
|
|
246
|
+
export function checkLearnAnswer(
|
|
247
|
+
value: unknown, shownIds: ReadonlySet<string>, ownerLinesShown: boolean,
|
|
248
|
+
): Checked<LearnAnswer> {
|
|
249
|
+
return checkAnswer(value, shownIds, { ownerLinesShown, orkeonCodeRules: true });
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** An answer refused only for what its owners would settle, read as the owner review reads it: with the owner lines
|
|
253
|
+
* shown, and an Orkeon Code motif's status and removed lines left unchecked, since its owner is never read and so
|
|
254
|
+
* shows no line. The refusals of that motif stay with the answer's own check; the other motifs still have their
|
|
255
|
+
* owner lines shown on the second try. */
|
|
256
|
+
export function checkForOwnerReview(value: unknown, shownIds: ReadonlySet<string>): Checked<LearnAnswer> {
|
|
257
|
+
return checkAnswer(value, shownIds, { ownerLinesShown: true, orkeonCodeRules: false });
|
|
258
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// The values the learner's prompt shows and its answer check reads: where an owner that is not a file of the checkout
|
|
2
|
+
// may live. Orkeon Code's own files are listed one by one (in shared/domain/dev/markers.ts, which --accept reads
|
|
3
|
+
// too), a harness owner is a rule of a repository pack.
|
|
4
|
+
import { HARNESS_REPO_PACKS } from "../../../shared/domain/dev/learn-proposals.ts";
|
|
5
|
+
|
|
6
|
+
/** The files of Orkeon Code a motif may name: shared with `--accept`, so defined beside the dev formats. */
|
|
7
|
+
export { ORKEON_CODE_DESTINATIONS } from "../../../shared/domain/dev/markers.ts";
|
|
8
|
+
|
|
9
|
+
/** Where a harness owner may live, in the orkeon-workshop repository: a rule of a repository pack. */
|
|
10
|
+
export const HARNESS_DESTINATIONS: readonly string[] = [`${HARNESS_REPO_PACKS}<name>/claude/rules/<file>`];
|
|
@@ -15,12 +15,21 @@ export const topicNotSlug = (at: string, topic: string, max: number): string =>
|
|
|
15
15
|
export const rowsEmpty = (at: string): string => `${at}: rows is empty`;
|
|
16
16
|
export const rowNotGiven = (at: string, id: string): string => `${at}: row '${id}' is not one of the rows given`;
|
|
17
17
|
export const rowTwice = (at: string, id: string): string => `${at}: row '${id}' is listed twice`;
|
|
18
|
-
export const ownerKindIs = (at: string): string => `${at}: owner_kind must be repository or harness`;
|
|
18
|
+
export const ownerKindIs = (at: string): string => `${at}: owner_kind must be repository, orkeon-code or harness`;
|
|
19
19
|
export const ownerPathNotRelative = (at: string, path: string): string => `${at}: owner_path '${path}' is not a relative path`;
|
|
20
20
|
export const deployedCopy = (at: string): string =>
|
|
21
|
-
`${at}: .claude/ is the harness's deployed copy: name the
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
`${at}: .claude/ is the harness's deployed copy: name the rule of a repository pack it comes from with owner_kind ` +
|
|
22
|
+
"harness, or one of the Orkeon Code destinations listed with owner_kind orkeon-code";
|
|
23
|
+
export const harnessOwnerUnder = (at: string, rule: string): string =>
|
|
24
|
+
`${at}: a harness owner is a rule of a repository pack, a file of the orkeon-workshop repository at ${rule}`;
|
|
25
|
+
export const orkeonCodeOwnerListed = (at: string, path: string): string =>
|
|
26
|
+
`${at}: '${path}' is not an Orkeon Code destination: name one of the files listed`;
|
|
27
|
+
/** Why an Orkeon Code owner takes status new alone: it is never read here, so no line of it was ever shown. */
|
|
28
|
+
export const orkeonCodeNewOnly = (at: string, status: string): string =>
|
|
29
|
+
`${at}: an Orkeon Code owner is never read here, so its motif takes status new, not ${status}`;
|
|
30
|
+
/** Why a new motif of an Orkeon Code owner removes no line: none of that owner was ever shown. */
|
|
31
|
+
export const orkeonCodeRemovesNothing = (at: string): string =>
|
|
32
|
+
`${at}: an Orkeon Code owner is never read here, so its motif of status new removes no line: leave lines_removed empty`;
|
|
24
33
|
export const checkIsOneOf = (at: string, kinds: string): string => `${at}: check must be one of ${kinds}`;
|
|
25
34
|
export const statusIs = (at: string): string => `${at}: status must be new, refines, replaces or removes`;
|
|
26
35
|
export const atProblem = (at: string, problem: string): string => `${at}: ${problem}`;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
//
|
|
11
11
|
// Input (globalThis.inputs): { source: string | null, replace?: boolean, hooks?: the /hooks registry,
|
|
12
12
|
// effort?: "low" | "medium" | "high" | "xhigh" | "max" | null, concurrency?: number, maxInstances?: number }
|
|
13
|
-
// Run standalone:
|
|
13
|
+
// Run standalone: ./orkeon-code run dev-plan --inputs '{"source":"prune"}'
|
|
14
14
|
//
|
|
15
15
|
// Budget: up to 59 index and batch_anchors calls by code, at most 40 folder listings for the anchors (one per folder for the run,
|
|
16
16
|
// both attempts sharing them), about 30 other file and git calls, two extract calls and one review of 20
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// The renderer of /dev-plan: a checked PlanAnswer, the inventory behind its anchors and
|
|
2
2
|
// the review become the global plan `<P>-PLAN.md` and one sheet `<P>-PLAN-F<k>.md` per
|
|
3
|
-
// batch. Pure, no IO. It
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// batch. Pure, no IO. It writes the plan's format - headings, table headers, the box and
|
|
4
|
+
// TDD lines - which plan-format.ts and sheet-facts.ts read back by the patterns of
|
|
5
|
+
// shared/domain/dev/markers.ts. It never checks the answer: checkPlanAnswer did.
|
|
6
6
|
|
|
7
7
|
import { BLOCKED_STATE } from "../../../shared/domain/dev/markers.ts";
|
|
8
8
|
import { DESIGN_RULE_IDS } from "../../../shared/domain/dev/design-rules.ts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// The spec file as code writes it from a checked SpecAnswer, its open questions and its decisions: the
|
|
2
|
-
//
|
|
3
|
-
// numbers stay
|
|
1
|
+
// The spec file as code writes it from a checked SpecAnswer, its open questions and its decisions: the twelve
|
|
2
|
+
// sections of SPEC_SECTIONS with a section 13 of decisions, a section left out when it has nothing to say (the
|
|
3
|
+
// numbers stay fixed, so a reader and /dev-plan find each section where they expect it). A use case and a
|
|
4
4
|
// rule carry a `- **Statement**:` line first, which spec-format.ts reads for /dev-plan. Pure, no IO.
|
|
5
5
|
import { STATEMENT } from "../../../shared/domain/dev/markers.ts";
|
|
6
6
|
import { decisionTable, questionTable } from "../../../shared/domain/dev/questions.ts";
|