@tachikomagundam/abathur 0.2.5 → 0.2.7

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.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/dist/cli.js +4 -0
  3. package/dist/commands/genome.js +2 -2
  4. package/dist/commands/graft.js +1 -1
  5. package/dist/commands/readjudicate.js +28 -0
  6. package/dist/commands/retract.js +53 -0
  7. package/dist/commands/run.js +1 -1
  8. package/dist/commands/self-eval.js +1 -1
  9. package/dist/commands/tombstone.js +30 -16
  10. package/dist/core/evolve/run-loop.js +14 -0
  11. package/dist/core/evolve/run-rows.js +14 -0
  12. package/dist/core/evolve/score-bank.js +214 -0
  13. package/dist/core/graft-rebench.js +3 -0
  14. package/dist/core/ledger.js +8 -1
  15. package/dist/core/promote.js +63 -47
  16. package/dist/core/readjudicate.js +247 -0
  17. package/dist/core/retract.js +166 -0
  18. package/dist/core/stats-math.js +39 -0
  19. package/dist/core/stats.js +93 -19
  20. package/dist/core/worktree.js +1 -1
  21. package/dist/genomes/toy-smoke/init.mjs +1 -1
  22. package/dist/test/bundle.test.js +1 -1
  23. package/dist/test/fixture-loop.test.js +1 -1
  24. package/dist/test/fixtures-self.js +1 -1
  25. package/dist/test/fixtures-wt.js +1 -1
  26. package/dist/test/friction.test.js +3 -3
  27. package/dist/test/graft.test.js +1 -1
  28. package/dist/test/historian-grader-integrity.test.js +509 -2
  29. package/dist/test/promote.test.js +222 -5
  30. package/dist/test/readjudicate.test.js +212 -0
  31. package/dist/test/reflect.test.js +1 -1
  32. package/dist/test/repopath-seams.test.js +55 -0
  33. package/dist/test/score-bank.test.js +235 -0
  34. package/dist/test/seam-gates.test.js +84 -0
  35. package/dist/test/self-snapshot.test.js +2 -2
  36. package/dist/test/stats-acceptance.test.js +329 -0
  37. package/graders/historian/grader-core.d.mts +27 -0
  38. package/graders/historian/grader-core.mjs +311 -19
  39. package/graders/historian/grader.mjs +5 -5
  40. package/graders/historian/judge-poststage-19.mjs +212 -0
  41. package/graders/historian/run-scenario-19.sh +43 -0
  42. package/graders/historian/run-scenario.sh +16 -0
  43. package/package.json +1 -1
  44. package/plugin/abathur-command.md +3 -3
  45. package/plugin/abathur.ts +6 -6
@@ -20,6 +20,22 @@
20
20
  set -euo pipefail
21
21
  unit_id="${1:?usage: run-scenario.sh <unitId> <scenario-file> [repoRoot]}"
22
22
  scenario_file="${2:?usage: run-scenario.sh <unitId> <scenario-file> [repoRoot]}"
23
+ # Per-unit hook dispatch (s19 autopsy 2026-09-25): a unit may own a hook script
24
+ # run-scenario-<NN>.sh that wraps THIS agent stage plus an instrumented poststage
25
+ # (e.g. the R6-termb 蜂判 for scenario-19). The registered runCommand is one
26
+ # genome-global string, so the dispatch lives here rather than in the spec: when
27
+ # this unit owns a hook and we are not already running inside it (recursion guard
28
+ # set on the way in), defer to the hook. Units without a hook — and every caller
29
+ # that passes an id with no matching file — fall through byte-identical (F1).
30
+ _here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
31
+ case "$unit_id" in
32
+ scenario-*)
33
+ _hook="$_here/run-scenario-${unit_id#scenario-}.sh"
34
+ if [ -f "$_hook" ] && [ -z "${ABATHUR_HOOK_INNER:-}" ]; then
35
+ exec env ABATHUR_HOOK_INNER=1 bash "$_hook" "$@"
36
+ fi
37
+ ;;
38
+ esac
23
39
  [ -f "$scenario_file" ] || { echo "run-scenario: missing scenario file $scenario_file" >&2; exit 2; }
24
40
  [ -n "${ABATHUR_TRANSCRIPT:-}" ] || { echo "run-scenario: ABATHUR_TRANSCRIPT not set" >&2; exit 2; }
25
41
  key="${ABATHUR_WIKI_KEY_FILE:-}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachikomagundam/abathur",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Evolution harness: observe failures, mutate, re-bench, select — human-gated promotion, offline lineage bundles.",
5
5
  "author": "TachikomaGundam",
6
6
  "type": "module",
@@ -9,7 +9,7 @@ top-level command (`genome`, `run`, `status`, `bundle`, `graft`, `self-eval`,
9
9
  with `command` set to the first word and `extra` set to the remaining tokens,
10
10
  then report the CLI exit code (0 ok / 1 blocked decision / 2 cannot-answer)
11
11
  and the relevant lines of its output. If no request was given, call the tool
12
- with `command: "--help"` and summarize the command list. `promote` and
13
- `tombstone` cannot be called through the tool at all — the tool refuses them.
12
+ with `command: "--help"` and summarize the command list. `promote`,
13
+ `tombstone` and `retract` cannot be called through the tool at all — the tool refuses them.
14
14
  They are human gates that belong to a terminal: if the user asks for one,
15
- tell them to run `abathur promote …` / `abathur tombstone …` there.
15
+ tell them to run `abathur promote …` / `abathur tombstone …` / `abathur retract …` there.
package/plugin/abathur.ts CHANGED
@@ -1,4 +1,4 @@
1
- // abathur-opencode-plugin v0.2.5
1
+ // abathur-opencode-plugin v0.2.7
2
2
  // Official opencode plugin adapter for the abathur evolution harness.
3
3
  // Registers ONE agent tool, `abathur`, that shells out to the abathur CLI —
4
4
  // argv-only (node:child_process execFile, never a shell), top-level commands
@@ -29,7 +29,7 @@ const TIMEOUT_MS = 120_000;
29
29
  const MAX_OUTPUT_BYTES = 64 * 1024;
30
30
 
31
31
  /** The seven tool-reachable top-level commands plus --help. Anything else is refused locally.
32
- * promote/tombstone are human gates and deliberately terminal-only (0.2.1): not reachable here. */
32
+ * promote/tombstone/retract are human gates and deliberately terminal-only (0.2.1/0.2.7): not reachable here. */
33
33
  const ALLOWED_COMMANDS: readonly string[] = [
34
34
  "genome",
35
35
  "run",
@@ -133,10 +133,10 @@ top-level command (\`genome\`, \`run\`, \`status\`, \`bundle\`, \`graft\`, \`sel
133
133
  with \`command\` set to the first word and \`extra\` set to the remaining tokens,
134
134
  then report the CLI exit code (0 ok / 1 blocked decision / 2 cannot-answer)
135
135
  and the relevant lines of its output. If no request was given, call the tool
136
- with \`command: "--help"\` and summarize the command list. \`promote\` and
137
- \`tombstone\` cannot be called through the tool at all — the tool refuses them.
136
+ with \`command: "--help"\` and summarize the command list. \`promote\`,
137
+ \`tombstone\` and \`retract\` cannot be called through the tool at all — the tool refuses them.
138
138
  They are human gates that belong to a terminal: if the user asks for one,
139
- tell them to run \`abathur promote …\` / \`abathur tombstone …\` there.
139
+ tell them to run \`abathur promote …\` / \`abathur tombstone …\` / \`abathur retract …\` there.
140
140
  `;
141
141
 
142
142
  export default {
@@ -168,7 +168,7 @@ export default {
168
168
  "(0 ok, 1 blocked decision, 2 cannot-answer). Honest privilege note: this " +
169
169
  "tool carries bash-equivalent privilege — `run` and `genome` legitimately " +
170
170
  "spawn mutator/engine binaries by design — so the allowlist limits typos " +
171
- "and UX, not capability. `promote` and `tombstone` are deliberately NOT " +
171
+ "and UX, not capability. `promote`, `tombstone` and `retract` are deliberately NOT " +
172
172
  "reachable here: they are human gates, run in a terminal.",
173
173
  args: {
174
174
  command: tool.schema