luciazero 2.3.0 → 2.4.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Naris (naris@riverpark.co.th)
3
+ Copyright (c) 2026 athit (athitfkm@gmail.com)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <img src="https://raw.githubusercontent.com/ohm41321/luciazero/main/docs/assets/lucia.png" width="220" alt="Lucia — Luciazero's mascot">
2
+ <img src="https://cdn.jsdelivr.net/gh/ohm41321/luciazero@37cb470e2b7c704ff32f3a46dbb125e312875960/docs/assets/lucia.png" width="220" alt="Lucia — Luciazero's mascot">
3
3
  <h1>Luciazero</h1>
4
4
  <p>
5
5
  <strong>Evidence-first discipline for coding agents.</strong><br>
@@ -8,11 +8,11 @@
8
8
  <p>
9
9
  <a href="https://www.npmjs.com/package/luciazero"><img src="https://img.shields.io/npm/v/luciazero" alt="npm version"></a>
10
10
  <a href="https://github.com/ohm41321/luciazero/actions/workflows/ci.yml"><img src="https://github.com/ohm41321/luciazero/actions/workflows/ci.yml/badge.svg" alt="CI status"></a>
11
- <a href="LICENSE"><img src="https://img.shields.io/github/license/ohm41321/luciazero" alt="MIT license"></a>
11
+ <a href="https://github.com/ohm41321/luciazero/blob/main/LICENSE"><img src="https://img.shields.io/github/license/ohm41321/luciazero" alt="MIT license"></a>
12
12
  </p>
13
13
  </div>
14
14
 
15
- **English** · [ภาษาไทย](README.th.md)
15
+ **English** · [ภาษาไทย](https://github.com/ohm41321/luciazero/blob/main/README.th.md)
16
16
 
17
17
  Luciazero is a lightweight discipline layer for coding agents. It works with
18
18
  Claude Code, Codex CLI, and compatible skill runtimes through plugin, CLI, or
@@ -21,7 +21,7 @@ skills-only installs.
21
21
  > Done is proven by a command, not by my judgment. If no verification command
22
22
  > exists, that is the first bug.
23
23
 
24
- It ships a compact [9-rule doctrine](claude/luciazero.md), 11 on-demand skills,
24
+ It ships a compact [9-rule doctrine](https://github.com/ohm41321/luciazero/blob/main/claude/luciazero.md), 11 on-demand skills,
25
25
  verification hooks, a risk-routed reviewer, and an eval harness. It is designed
26
26
  to make completion claims auditable—not to replace an agent runtime or become an
27
27
  overnight orchestrator.
@@ -31,7 +31,7 @@ overnight orchestrator.
31
31
  This GIF is driven by the shipped hooks, not a mockup:
32
32
 
33
33
  <p align="center">
34
- <img src="https://raw.githubusercontent.com/ohm41321/luciazero/main/docs/assets/statusline-demo.gif" width="720" alt="Edit becomes unverified, a red check stays red, and a successful verify turns green">
34
+ <img src="https://cdn.jsdelivr.net/gh/ohm41321/luciazero@37cb470e2b7c704ff32f3a46dbb125e312875960/docs/assets/statusline-demo.gif" width="720" alt="Edit becomes unverified, a red check stays red, and a successful verify turns green">
35
35
  </p>
36
36
 
37
37
  ```text
@@ -53,30 +53,34 @@ This GIF is driven by the shipped hooks, not a mockup:
53
53
  | Context lost between agents | `/lucia-relay` transfers evidence, next action, and negative knowledge |
54
54
 
55
55
  Mechanical guarantees run in `test.sh`; behavioral claims are measured by the
56
- [eval harness](eval/README.md).
56
+ [eval harness](https://github.com/ohm41321/luciazero/blob/main/eval/README.md).
57
57
 
58
58
  ## Keep work portable
59
59
 
60
60
  `/lucia-relay` transfers decisions and evidence instead of dumping a chat
61
61
  transcript. Session A writes canonical `LUCIA_RELAY.json` plus a generated
62
- human view; session B checks the Git fingerprint, reads the exact next action
63
- and refuted hypotheses, re-runs verification, then explicitly consumes the
64
- relay.
65
-
66
- Relay decides where the recipient is before it writes pointers. Same-machine
67
- receivers may use full local paths. Cross-machine relays require a clean pushed
68
- commit, reject machine-only paths, and carry otherwise-local knowledge inline
69
- in the JSON.
62
+ human view; session B checks trusted repository identity, HEAD, and manifest
63
+ digest, reads the exact next action and negative knowledge, re-runs every
64
+ approved verification command in its own harness, then explicitly consumes.
65
+
66
+ Same-machine receivers may use local paths and schema 1/2. Cross-machine schema
67
+ 3 is created only after commit and push: it publishes a commit-named transfer
68
+ tag and records a sanitized clone URL, head/base OIDs, committed changed files,
69
+ and inline knowledge.
70
+ The receiver supplies the expected route, HEAD, and manifest digest independently, so a
71
+ forged artifact cannot downgrade validation. Detached checkouts are supported;
72
+ Relay never executes artifact commands. The receiver runs them in its coding
73
+ harness and passes `consume --verified` only after every result matches.
70
74
 
71
75
  <p align="center">
72
- <img src="https://raw.githubusercontent.com/ohm41321/luciazero/main/docs/assets/relay-demo.gif" width="720" alt="One session creates a Lucia Relay; another validates it, detects repository drift, re-runs evidence, and consumes it">
76
+ <img src="https://cdn.jsdelivr.net/gh/ohm41321/luciazero@37cb470e2b7c704ff32f3a46dbb125e312875960/docs/assets/relay-demo.gif" width="720" alt="One session creates a Lucia Relay; another validates it, detects repository drift, re-runs evidence, and consumes it">
73
77
  </p>
74
78
 
75
- The GIF runs the [shipped implementation](docs/assets/relay-demo.sh) in a
79
+ The GIF runs the [shipped implementation](https://github.com/ohm41321/luciazero/blob/main/docs/assets/relay-demo.sh) in a
76
80
  temporary Git repository. CI's `relay-transfer` fixture scores the complete
77
81
  reference 6/6 and rejects a generic Markdown handoff (1/6) plus a
78
82
  content-complete but stale fingerprint (5/6). Those are mechanical protocol
79
- checks—not model-uplift results. See the [method and limits](docs/benchmark.md#skill-protocol-evidence).
83
+ checks—not model-uplift results. See the [method and limits](https://github.com/ohm41321/luciazero/blob/main/docs/benchmark.md#skill-protocol-evidence).
80
84
 
81
85
  ## Install
82
86
 
@@ -217,9 +221,9 @@ Snapshot: 2026-08-12.
217
221
 
218
222
  *One Luciazero run was invalidated by model capacity. †This is a
219
223
  **ceiling-effect warning, not evidence of uplift or no effect**: the pilot has
220
- only one run per arm per task. See the [full benchmark](docs/benchmark.md),
221
- [campaign registry](eval/results/campaigns.json), and
222
- [raw pilot rows](eval/results/gpt-5.6-terra-medium-pilot-2026-08-12.jsonl).
224
+ only one run per arm per task. See the [full benchmark](https://github.com/ohm41321/luciazero/blob/main/docs/benchmark.md),
225
+ [campaign registry](https://github.com/ohm41321/luciazero/blob/main/eval/results/campaigns.json), and
226
+ [raw pilot rows](https://github.com/ohm41321/luciazero/blob/main/eval/results/gpt-5.6-terra-medium-pilot-2026-08-12.jsonl).
223
227
 
224
228
  <!-- END GENERATED: benchmark-evidence -->
225
229
 
@@ -246,7 +250,7 @@ only one run per arm per task. See the [full benchmark](docs/benchmark.md),
246
250
  - Windows: the installers and hooks are Bash scripts — run them under WSL.
247
251
  `npx luciazero discipline` works in native Node.
248
252
 
249
- See [SECURITY.md](SECURITY.md) for the complete trust boundary.
253
+ See [SECURITY.md](https://github.com/ohm41321/luciazero/blob/main/SECURITY.md) for the complete trust boundary.
250
254
 
251
255
  ## Developing Luciazero
252
256
 
@@ -264,14 +268,14 @@ tier.
264
268
 
265
269
  More detail:
266
270
 
267
- - [Architecture and trade-offs](docs/comparison.md)
268
- - [Eval methodology](eval/README.md)
269
- - [Benchmark results and GPT plan](docs/benchmark.md)
270
- - [Raw campaign registry](eval/results/campaigns.json)
271
- - [Experiment log](docs/experiments.md)
272
- - [Contributing](CONTRIBUTING.md)
273
- - [Publishing](docs/publishing.md)
274
- - [Changelog](CHANGELOG.md)
271
+ - [Architecture and trade-offs](https://github.com/ohm41321/luciazero/blob/main/docs/comparison.md)
272
+ - [Eval methodology](https://github.com/ohm41321/luciazero/blob/main/eval/README.md)
273
+ - [Benchmark results and GPT plan](https://github.com/ohm41321/luciazero/blob/main/docs/benchmark.md)
274
+ - [Raw campaign registry](https://github.com/ohm41321/luciazero/blob/main/eval/results/campaigns.json)
275
+ - [Experiment log](https://github.com/ohm41321/luciazero/blob/main/docs/experiments.md)
276
+ - [Contributing](https://github.com/ohm41321/luciazero/blob/main/CONTRIBUTING.md)
277
+ - [Publishing](https://github.com/ohm41321/luciazero/blob/main/docs/publishing.md)
278
+ - [Changelog](https://github.com/ohm41321/luciazero/blob/main/CHANGELOG.md)
275
279
 
276
280
  ## Support the project
277
281
 
@@ -281,8 +285,8 @@ a Thai-language Discord bot. If Luciazero saves you review cycles, you can
281
285
 
282
286
  ## License
283
287
 
284
- [MIT](LICENSE)
288
+ [MIT](https://github.com/ohm41321/luciazero/blob/main/LICENSE)
285
289
 
286
290
  ## ภาษาไทย
287
291
 
288
- README ฉบับภาษาไทยเต็ม: [README.th.md](README.th.md)
292
+ README ฉบับภาษาไทยเต็ม: [README.th.md](https://github.com/ohm41321/luciazero/blob/main/README.th.md)
@@ -1,49 +1,57 @@
1
1
  ---
2
2
  name: reviewer
3
- description: Risk-routed adversarial code reviewer with general, security, and contract focus modes. Spawn before declaring a risky change done, or when asked to review a diff, branch, or PR. Tries to refute the change, reads callers and consumers, and never edits files. If the harness offers a built-in adversarial review command, prefer it; use this agent when none exists or an independent focused pass is wanted.
3
+ description: Adversarial reviewer with general, security, and contract routes. Use for diffs or risky closeout. Prefer built-in review; otherwise use this agent independently. Verifies callers and consumers, never edits, and prefers no finding over a false one.
4
4
  tools: Read, Grep, Glob, Bash
5
5
  model: inherit
6
6
  ---
7
7
 
8
- You are an adversarial code reviewer. Your job is to **refute** the change, not to approve it. Hunt for a real problem; praise is noise and is forbidden. An empty result after a genuine search is better than an invented finding.
8
+ # Reviewer
9
9
 
10
- ## Input
10
+ Refute the change; do not approve or praise it. Find verified defects that the
11
+ happy-path checks missed. A clean result is better than a speculative finding.
11
12
 
12
- You are given a diff, branch, PR, or changed-file list and an optional `focus`: `general` (default), `security`, or `contract`. If given a branch or nothing specific, derive the diff (`git diff`, `git diff main...HEAD`, `git show`). Read enough surrounding code to judge every hunk, then search call sites, consumers, schemas, and tests that still rely on the old behavior.
13
+ ## Route the search
13
14
 
14
- ## What to hunt
15
+ Input is a diff, branch, PR, changed-file list, and optional focus: `general`
16
+ (default), `security`, or `contract`. Derive the diff when needed. Read each
17
+ hunk in context, then rank risks by impact and reachability; investigate the
18
+ highest first instead of applying every checklist item equally.
15
19
 
16
- Automated checks already cover the happy path. Hunt what they do not:
20
+ - `security`: trace each changed trust boundary from external input to a
21
+ sensitive sink. Check validation, authorization, encoding, path containment,
22
+ command/query construction, secrets, failure defaults, and error disclosure.
23
+ - `contract`: identify the old observable shape, then search callers,
24
+ consumers, fixtures, docs, serializers, migrations, and compatibility code.
25
+ Include changed defaults and parse/format drift.
26
+ - `general`: prioritize error paths, state transitions, concurrency, resource
27
+ cleanup, and material edge cases.
17
28
 
18
- - **Edge cases** empty input, zero, negative, unicode, max length, first/last element, concurrent access
19
- - **Error paths** what happens when the call fails, the file is missing, the network drops; are errors swallowed?
20
- - **Changed contracts** public API shape, serialized formats, DB schema, config keys: does anything else consume the old shape?
21
- - **Unintended diff content** — files touched by accident, debug prints, commented-out code, secrets, dependency pins loosened
22
- - **Resource discipline** — leaks (handles, connections, subscriptions), missing cleanup on the error path
23
- - **Test honesty** — do the new/changed tests actually fail if the change is reverted? Tests that assert nothing, or were weakened to pass, are findings.
24
- - **Security** — injection via interpolated input, path traversal, secrets in code or logs
29
+ For every route also inspect unintended diff content, dependency changes, debug
30
+ artifacts, swallowed failures, and test honesty. A changed test is suspect if it
31
+ would still pass when the implementation is reverted.
25
32
 
26
- ## Focus routes
33
+ ## Evidence discipline
27
34
 
28
- - `security`: map every changed trust boundary from input to sensitive sink. Check validation, encoding, authorization, failure defaults, path containment, command/query construction, secret handling, and error disclosure. Read endpoint wiring and permission callers—not only the changed function.
29
- - `contract`: identify the old externally observable shape, then search all in-repo consumers, fixtures, docs, serializers, migrations, and compatibility shims. Treat silent default changes and parse/format drift as contracts too.
30
- - `general`: apply the whole checklist with extra attention to error paths, state transitions, concurrency, and resource cleanup.
35
+ Confirm each suspected defect in source before reporting it. Read direct callers
36
+ and consumers when they can prove reachability or compatibility. Use cheap,
37
+ read-only commands when decisive. Never edit, commit, or push.
31
38
 
32
- ## Rules
33
-
34
- - **Verify before reporting.** Read the actual code for each suspected finding. A finding you did not confirm against the source is speculation — drop it or mark it explicitly as unverified.
35
- - Run cheap read-only commands when they settle a question (`git log` for context, the test suite if it is fast). Never edit, never commit, never push.
36
- - No style or formatting nits unless they change meaning.
37
- - Stay inside the diff's causal scope; a defect in an unchanged consumer broken by the diff is in scope. Pre-existing unrelated problems go in one short "outside scope" line at the end.
39
+ Stay inside the diff's causal scope. No style or formatting findings unless they
40
+ change behavior. Do not narrate the search. Report every verified
41
+ `blocker`/`major`; report at most three `minor` findings, ranked by impact.
38
42
 
39
43
  ## Output
40
44
 
41
- One line per finding, most severe first:
45
+ One line per finding, severe first:
42
46
 
43
47
  ```
44
48
  path:line — severity — problem. Concrete fix.
45
49
  ```
46
50
 
47
- Severity: `blocker` (exploitable security, data loss, or fundamentally wrong result) / `major` (breaks a supported contract, permission boundary, or material edge case) / `minor` (works now, but has a concrete fragility).
51
+ - `blocker`: exploitable security issue, data loss, or fundamentally wrong result
52
+ - `major`: supported contract or permission boundary breaks
53
+ - `minor`: concrete fragility without an immediate material break
48
54
 
49
- If, after a genuine hunt, nothing survives verification: report exactly `No findings.` plus one sentence on what you checked. Do **not** invent findings to seem useful — a false finding costs more than an empty report.
55
+ If nothing survives verification, output exactly `No findings.` plus one short
56
+ sentence naming the boundaries checked. Put unrelated pre-existing defects in
57
+ one optional `Outside scope:` line.
@@ -1,49 +1,57 @@
1
1
  ---
2
2
  name: reviewer
3
- description: Risk-routed adversarial code reviewer with general, security, and contract focus modes. Spawn before declaring a risky change done, or when asked to review a diff, branch, or PR. Tries to refute the change, reads callers and consumers, and never edits files. If the harness offers a built-in adversarial review command, prefer it; use this agent when none exists or an independent focused pass is wanted.
3
+ description: Adversarial reviewer with general, security, and contract routes. Use for diffs or risky closeout. Prefer built-in review; otherwise use this agent independently. Verifies callers and consumers, never edits, and prefers no finding over a false one.
4
4
  tools: Read, Grep, Glob, Bash
5
5
  model: inherit
6
6
  ---
7
7
 
8
- You are an adversarial code reviewer. Your job is to **refute** the change, not to approve it. Hunt for a real problem; praise is noise and is forbidden. An empty result after a genuine search is better than an invented finding.
8
+ # Reviewer
9
9
 
10
- ## Input
10
+ Refute the change; do not approve or praise it. Find verified defects that the
11
+ happy-path checks missed. A clean result is better than a speculative finding.
11
12
 
12
- You are given a diff, branch, PR, or changed-file list and an optional `focus`: `general` (default), `security`, or `contract`. If given a branch or nothing specific, derive the diff (`git diff`, `git diff main...HEAD`, `git show`). Read enough surrounding code to judge every hunk, then search call sites, consumers, schemas, and tests that still rely on the old behavior.
13
+ ## Route the search
13
14
 
14
- ## What to hunt
15
+ Input is a diff, branch, PR, changed-file list, and optional focus: `general`
16
+ (default), `security`, or `contract`. Derive the diff when needed. Read each
17
+ hunk in context, then rank risks by impact and reachability; investigate the
18
+ highest first instead of applying every checklist item equally.
15
19
 
16
- Automated checks already cover the happy path. Hunt what they do not:
20
+ - `security`: trace each changed trust boundary from external input to a
21
+ sensitive sink. Check validation, authorization, encoding, path containment,
22
+ command/query construction, secrets, failure defaults, and error disclosure.
23
+ - `contract`: identify the old observable shape, then search callers,
24
+ consumers, fixtures, docs, serializers, migrations, and compatibility code.
25
+ Include changed defaults and parse/format drift.
26
+ - `general`: prioritize error paths, state transitions, concurrency, resource
27
+ cleanup, and material edge cases.
17
28
 
18
- - **Edge cases** empty input, zero, negative, unicode, max length, first/last element, concurrent access
19
- - **Error paths** what happens when the call fails, the file is missing, the network drops; are errors swallowed?
20
- - **Changed contracts** public API shape, serialized formats, DB schema, config keys: does anything else consume the old shape?
21
- - **Unintended diff content** — files touched by accident, debug prints, commented-out code, secrets, dependency pins loosened
22
- - **Resource discipline** — leaks (handles, connections, subscriptions), missing cleanup on the error path
23
- - **Test honesty** — do the new/changed tests actually fail if the change is reverted? Tests that assert nothing, or were weakened to pass, are findings.
24
- - **Security** — injection via interpolated input, path traversal, secrets in code or logs
29
+ For every route also inspect unintended diff content, dependency changes, debug
30
+ artifacts, swallowed failures, and test honesty. A changed test is suspect if it
31
+ would still pass when the implementation is reverted.
25
32
 
26
- ## Focus routes
33
+ ## Evidence discipline
27
34
 
28
- - `security`: map every changed trust boundary from input to sensitive sink. Check validation, encoding, authorization, failure defaults, path containment, command/query construction, secret handling, and error disclosure. Read endpoint wiring and permission callers—not only the changed function.
29
- - `contract`: identify the old externally observable shape, then search all in-repo consumers, fixtures, docs, serializers, migrations, and compatibility shims. Treat silent default changes and parse/format drift as contracts too.
30
- - `general`: apply the whole checklist with extra attention to error paths, state transitions, concurrency, and resource cleanup.
35
+ Confirm each suspected defect in source before reporting it. Read direct callers
36
+ and consumers when they can prove reachability or compatibility. Use cheap,
37
+ read-only commands when decisive. Never edit, commit, or push.
31
38
 
32
- ## Rules
33
-
34
- - **Verify before reporting.** Read the actual code for each suspected finding. A finding you did not confirm against the source is speculation — drop it or mark it explicitly as unverified.
35
- - Run cheap read-only commands when they settle a question (`git log` for context, the test suite if it is fast). Never edit, never commit, never push.
36
- - No style or formatting nits unless they change meaning.
37
- - Stay inside the diff's causal scope; a defect in an unchanged consumer broken by the diff is in scope. Pre-existing unrelated problems go in one short "outside scope" line at the end.
39
+ Stay inside the diff's causal scope. No style or formatting findings unless they
40
+ change behavior. Do not narrate the search. Report every verified
41
+ `blocker`/`major`; report at most three `minor` findings, ranked by impact.
38
42
 
39
43
  ## Output
40
44
 
41
- One line per finding, most severe first:
45
+ One line per finding, severe first:
42
46
 
43
47
  ```
44
48
  path:line — severity — problem. Concrete fix.
45
49
  ```
46
50
 
47
- Severity: `blocker` (exploitable security, data loss, or fundamentally wrong result) / `major` (breaks a supported contract, permission boundary, or material edge case) / `minor` (works now, but has a concrete fragility).
51
+ - `blocker`: exploitable security issue, data loss, or fundamentally wrong result
52
+ - `major`: supported contract or permission boundary breaks
53
+ - `minor`: concrete fragility without an immediate material break
48
54
 
49
- If, after a genuine hunt, nothing survives verification: report exactly `No findings.` plus one sentence on what you checked. Do **not** invent findings to seem useful — a false finding costs more than an empty report.
55
+ If nothing survives verification, output exactly `No findings.` plus one short
56
+ sentence naming the boundaries checked. Put unrelated pre-existing defects in
57
+ one optional `Outside scope:` line.
@@ -220,20 +220,12 @@ KEY="$(printf '%s' "${CWD}" | python3 -c 'import sys,hashlib;print(hashlib.md5(s
220
220
  BASE="${TMPDIR:-/tmp}/luciazero-verify-state-$(id -u 2>/dev/null || echo unknown)"
221
221
  # The base name is predictable, so validate ownership/type before touching it.
222
222
  # A hostile pre-created symlink or directory makes the hook fail open.
223
- python3 - "${BASE}" <<'PY' 2>/dev/null || exit 0
224
- import os, stat, sys
225
- path = sys.argv[1]
226
- try:
227
- info = os.lstat(path)
228
- except FileNotFoundError:
229
- os.mkdir(path, 0o700)
230
- info = os.lstat(path)
231
- if not stat.S_ISDIR(info.st_mode) or stat.S_ISLNK(info.st_mode):
232
- raise SystemExit(1)
233
- if hasattr(os, "getuid") and info.st_uid != os.getuid():
234
- raise SystemExit(1)
235
- os.chmod(path, 0o700)
236
- PY
223
+ if [ -e "${BASE}" ] || [ -L "${BASE}" ]; then
224
+ [ -d "${BASE}" ] && [ ! -L "${BASE}" ] && [ -O "${BASE}" ] || exit 0
225
+ else
226
+ (umask 077 && mkdir "${BASE}") 2>/dev/null || exit 0
227
+ fi
228
+ chmod 700 "${BASE}" 2>/dev/null || exit 0
237
229
  STATE="${BASE}/${KEY}"
238
230
  mkdir -p "${STATE}" 2>/dev/null || exit 0
239
231
  chmod 700 "${STATE}" 2>/dev/null || exit 0
package/install-codex.sh CHANGED
@@ -27,6 +27,10 @@ skill_inventory() {
27
27
  catalog "${SRC}/skills/catalog.txt"
28
28
  catalog "${SRC}/skills/aliases.txt"
29
29
  }
30
+ version_of() {
31
+ awk -F '"' '/^[[:space:]]*"version"[[:space:]]*:/ { print $4; exit }' \
32
+ "${SRC}/package.json" 2>/dev/null || true
33
+ }
30
34
 
31
35
  # collision-proof backup path for $1 (two runs in the same second must not overwrite)
32
36
  bakpath() {
@@ -151,7 +155,7 @@ while IFS= read -r AGENT_NAME; do
151
155
  done < <(catalog "${SRC}/claude/agents/catalog.txt")
152
156
 
153
157
  # 4. version sidecar (informational; removed by uninstall-codex.sh)
154
- V_NEW="$(grep -m1 -oE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' "${SRC}/CHANGELOG.md" 2>/dev/null | tr -d '#[] ' || true)"
158
+ V_NEW="$(version_of)"
155
159
  if [ -n "${V_NEW}" ]; then
156
160
  printf '%s\n' "${V_NEW}" > "${CODEX_DIR}/.luciazero-version"
157
161
  fi
package/install.sh CHANGED
@@ -34,9 +34,10 @@ skill_inventory() {
34
34
  catalog "${SRC}/skills/aliases.txt"
35
35
  }
36
36
 
37
- # newest released version in this checkout's CHANGELOG (informational)
37
+ # Package metadata is present in git checkouts and npm payloads alike.
38
38
  version_of() {
39
- grep -m1 -oE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' "${SRC}/CHANGELOG.md" 2>/dev/null | tr -d '#[] ' || true
39
+ awk -F '"' '/^[[:space:]]*"version"[[:space:]]*:/ { print $4; exit }' \
40
+ "${SRC}/package.json" 2>/dev/null || true
40
41
  }
41
42
 
42
43
  if [ "${STATUS_ONLY}" = 1 ]; then
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "luciazero",
3
- "version": "2.3.0",
3
+ "version": "2.4.2",
4
4
  "description": "Verification-first discipline for coding agents (Claude Code + Codex CLI): 9-rule doctrine, 11 skills, risk-routed reviewer, fail-open enforcement hooks. npx luciazero installs it.",
5
- "repository": { "type": "git", "url": "git+https://github.com/ohm41321/luciazero.git" },
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/ohm41321/luciazero.git"
8
+ },
6
9
  "homepage": "https://github.com/ohm41321/luciazero#readme",
7
- "bugs": { "url": "https://github.com/ohm41321/luciazero/issues" },
10
+ "author": { "name": "athit", "email": "athitfkm@gmail.com" },
11
+ "bugs": {
12
+ "url": "https://github.com/ohm41321/luciazero/issues"
13
+ },
8
14
  "bin": {
9
15
  "luciazero": "bin/luciazero.js"
10
16
  },
@@ -17,8 +23,7 @@
17
23
  "install.sh",
18
24
  "uninstall.sh",
19
25
  "install-codex.sh",
20
- "uninstall-codex.sh",
21
- "CHANGELOG.md"
26
+ "uninstall-codex.sh"
22
27
  ],
23
28
  "engines": {
24
29
  "node": ">=18"
@@ -3,24 +3,27 @@ name: bisect
3
3
  description: Pinpoint the first bad commit for a reproducible regression in a safe temporary worktree. Use when HEAD is bad, a known revision is good, and one unattended command distinguishes them; handles flaky endpoints and git-bisect skip exit 125.
4
4
  ---
5
5
 
6
- # Bisect — isolate the first bad commit safely
6
+ # Bisect
7
7
 
8
8
  ## 1. Freeze the criterion
9
9
 
10
- Confirm the bad endpoint fails and identify a good commit or tag. Use one unattended command whose exit `0` means good, `1–124` means bad, and `125` means the revision cannot be tested. A missing executable is an infrastructure error, not evidence that a revision is bad.
10
+ Confirm the bad endpoint fails and name a good commit or tag. One unattended
11
+ command decides: exit `0` means good, `1–124` means bad, and `125` means
12
+ untestable. A missing executable is an infrastructure error.
11
13
 
12
14
  ## 2. Run in a throwaway worktree
13
15
 
14
- Locate this skill's installed directory, stay in the repository under investigation, and invoke the bundled script by its absolute path:
15
-
16
16
  ```bash
17
17
  <this-skill-dir>/scripts/safe-bisect.sh --good <good-rev> --bad <bad-rev> -- <verify-command> [args...]
18
18
  ```
19
19
 
20
- The script resolves both endpoints, repeats each endpoint twice to catch instability, creates a detached temporary worktree, cleans generated state between revisions, runs `git bisect`, resets it, and removes the worktree on every exit path. Use `--retries N` only when the reproduction needs more endpoint samples.
21
-
22
- Do not run it for a nondeterministic symptom. Make the reproduction deterministic first through `/debug`.
20
+ The helper repeats each endpoint twice, uses a detached temporary worktree,
21
+ cleans state, resets bisect, and removes the worktree on every exit path. Use
22
+ `--retries N` only for endpoint samples. Make the reproduction deterministic
23
+ first through `/debug`.
23
24
 
24
25
  ## 3. Interpret narrowly
25
26
 
26
- Report the result as the **first bad commit**, not automatically the root cause. Read its diff and relevant callers, then feed that evidence into `/debug` as a hypothesis. Keep the reproduction as a regression test and run the full verification tier after the fix.
27
+ Report the first bad commit, not automatically the root cause. Read its diff and
28
+ relevant callers; feed `/debug`, keep the regression test, and run the full
29
+ verification tier after fixing.
@@ -3,49 +3,55 @@ name: debug
3
3
  description: Debug a stubborn bug with a deterministic reproduction, hypothesis ledger, one-variable fixes, and a regression test. Use after the first obvious look fails, reproduction is unclear, or a fix attempt failed. Not for routine obvious failures; use for "ไล่บั๊ก".
4
4
  ---
5
5
 
6
- # Debug — hypothesis before edit
6
+ # Debug
7
7
 
8
- The doctrine says: *debugging starts with a hypothesis, not an edit.* Mutating code until the test goes green is not debugging — it is how plausible-but-wrong fixes ship. This is the procedure for bugs that resist the first obvious look.
8
+ For bugs that resist the first obvious look: debugging starts with a hypothesis,
9
+ not an edit. Reality, not a plausible patch, decides.
9
10
 
10
11
  ## 1. Reproduce first
11
12
 
12
- One command that shows the failure deterministically. This command is the ground truth for the whole session — every hypothesis is judged against it.
13
+ Find one command that shows the failure deterministically. It is ground truth.
14
+ Do not theorize about causes of a failure you cannot trigger.
13
15
 
14
- - If it cannot be reproduced yet, that is the entire current task. Do not theorize about causes of a failure you cannot trigger.
15
- - If it is intermittent, make it deterministic before proceeding: fix the seed, pin the time/timezone, run it in a loop (`for i in $(seq 20)`) until the trigger condition is understood. An intermittent repro means the hypothesis space still contains "timing/state you have not seen".
16
+ For intermittent failures, fix the seed, pin the time/timezone, run it in a loop,
17
+ and identify the trigger before proceeding.
16
18
 
17
19
  ## 2. Minimize
18
20
 
19
- Shrink the reproduction — smaller input, fewer flags, one test instead of the suite — until the failure is small enough to reason about. Every element removed eliminates a family of hypotheses for free. Stop minimizing when shrinking stops being cheap.
21
+ Shrink to smaller input, fewer flags, one test instead of the suite. Stop when
22
+ further reduction costs more than it clarifies.
20
23
 
21
24
  ## 3. Hypothesis ledger
22
25
 
23
- **Seed it from recorded experience first.** Before inventing hypotheses, grep the symptom's keywords (error strings, subsystem names) against two files, if they exist:
26
+ Before inventing causes, search the symptom in:
24
27
 
25
- - the repo's lesson ledger `docs/lessons.md` — this project's previously debugged failures;
26
- - the global heuristics file `luciazero-heuristics.md` in the configured harness directory (`${CLAUDE_CONFIG_DIR:-$HOME/.claude}` or `${CODEX_HOME:-$HOME/.codex}`) — cross-repo lessons. Use the configured path instead of assuming `~/.claude` or `~/.codex`.
28
+ - repo ledger `docs/lessons.md`;
29
+ - configured harness `luciazero-heuristics.md` under
30
+ `${CLAUDE_CONFIG_DIR:-$HOME/.claude}` or
31
+ `${CODEX_HOME:-$HOME/.codex}`.
27
32
 
28
- A match becomes **H1** still verify it with its `proven-by` command; a ledger match is a hypothesis with a head start, not a conclusion. No match, or no files: proceed normally.
29
-
30
- Keep a visible ledger in the conversation. Each entry:
33
+ A match becomes **H1**, but must pass its `proven-by` observation.
31
34
 
32
35
  ```
33
- H<N>: <suspected cause> — refutable by: <command / observation> → <result: refuted | confirmed | pending>
36
+ H<N>: <suspected cause> — refutable by: <command / observation> → <refuted|confirmed|pending>
34
37
  ```
35
38
 
36
- - **Run the observation, not the edit.** Choose the cheapest command whose output discriminates between this hypothesis and the alternatives — a log line, a targeted print, a debugger break, one `grep`, `git bisect run <verify-cmd>` when a known-good commit exists.
37
- - Prefer reading real state over reasoning about imagined state. The bug exists precisely because the mental model and reality differ — trust output.
38
- - Dead hypotheses stay in the ledger marked refuted, so they are not silently retried an hour later.
39
+ Run the observation, not the edit. Choose the cheapest discriminating log,
40
+ query, debugger stop, grep, or bisect. Trust real state. Dead hypotheses stay in
41
+ the ledger marked refuted. Keep the ledger visible in the conversation.
39
42
 
40
43
  ## 4. One variable per iteration
41
44
 
42
- - Change one thing, re-run the reproduction, record the result in the ledger.
43
- - A fix attempt that failed gets **reverted before the next attempt** stacked failed fixes create a second bug on top of the first.
44
- - Two consecutive failed fixes on the same hypothesis means the hypothesis is dead, not unlucky. Widen the search: environment, dependency versions, input data, concurrency, or the test itself being wrong.
45
+ Change one thing, re-run the reproduction, and record the result. A failed fix
46
+ gets **reverted before the next attempt**. Two consecutive failed fixes on the
47
+ same hypothesis means the hypothesis is dead; widen to environment, versions,
48
+ input, concurrency, or a wrong test.
45
49
 
46
50
  ## 5. Close out
47
51
 
48
- - The reproduction becomes a committed regression test: **red before the fix, green after** — run it both ways and quote both results. This proves the fix touched the actual cause. The mechanical form lives in the done skill's `scripts/` dir — locate that installed skill and run `<this-skill-dir>/scripts/revert-probe.sh "<verify-cmd>"`.
49
- - Remove all instrumentation (prints, sleeps, debug flags) check the diff for it explicitly.
50
- - Run the full verify tier, not just the one test.
51
- - If the session surfaced something reading the code cannot teach (a footgun, an environment quirk, a disproven approach), run `/retro` so the next session does not pay for this one's dead ends — for a debugged failure specifically, `/retro` records it in `docs/lessons.md` (symptom → cause → proven-by → fix), which is exactly what step 3 reads next time.
52
+ - Commit a regression test. Run it both ways and quote both results: red before
53
+ the fix, green after. Use the done skill's `revert-probe.sh` when applicable.
54
+ - Remove all instrumentation: prints, sleeps, debug flags.
55
+ - Run the full verify tier.
56
+ - If the cause, footgun, or null result is not obvious from code, run `/retro`;
57
+ debugged failures go to `docs/lessons.md` as symptom → cause → proof → fix.
@@ -3,7 +3,7 @@ name: discipline-report
3
3
  description: Analyze Luciazero stop-outcome logs for evidence-backed verification habits. Use for discipline stats, recurring nudge or strict-block patterns, local behavior reports, or machine-readable JSON.
4
4
  ---
5
5
 
6
- # Discipline report — turn local outcomes into evidence
6
+ # Discipline report
7
7
 
8
8
  Resolve the first available local CLI:
9
9
 
@@ -12,12 +12,22 @@ luciazero discipline [--days N] [--project PATH_OR_ID] [--json]
12
12
  node <this-skill-dir>/../../bin/luciazero.js discipline [--days N] [--project PATH_OR_ID] [--json]
13
13
  ```
14
14
 
15
- Use the first command only when `luciazero` is on PATH; use the second from a source checkout or npm package. If neither local form exists, report that the discipline report is unavailable offline instead of silently invoking `npx`. Use `npx` only when package resolution is explicitly allowed.
15
+ Use the first only when on PATH; use the second from a checkout/package. If
16
+ neither local form exists, report unavailable offline. Use `npx` only when
17
+ package resolution is explicitly allowed.
16
18
 
17
- The report reads `luciazero-stats.log` from the Claude config directory by default. It accepts current schema-versioned JSON lines and legacy space-delimited records, ignores malformed lines without failing, and never sends data over the network. New enforcement-pack installs also summarize measured turn/Bash wall-clock milliseconds and Bash, verify, and model/user skill invocation counts. Parallel Bash intervals are merged before subtraction. These are aggregates: raw commands and skill names are never persisted.
19
+ The command reads `luciazero-stats.log`, accepts current
20
+ schema-versioned JSON lines and legacy space-delimited records, ignores malformed
21
+ lines without failing, and never sends data over the network. Telemetry includes
22
+ turn/Bash wall time plus Bash, verify, and skill counts; parallel Bash intervals
23
+ are merged. Raw commands and skill names are never persisted.
18
24
 
19
- Treat recorded outcomes as observations, not causes. A `nudge` proves an edit lacked a recognized later verify run; it does not prove why. A `strict-block` proves the configured strict command was red. Recommendations derived from patterns must say `likely` unless the log directly records the cause.
25
+ Treat recorded outcomes as observations, not causes. `nudge` means no recognized
26
+ later verify; `strict-block` means its strict command was red. Explanations must
27
+ say `likely` unless the log records the cause.
20
28
 
21
- Latency telemetry separates observed Bash time from the rest of the measured turn. The non-Bash remainder can include model reasoning, non-Bash tools, hook overhead, and harness scheduling, so do not label it as model latency without another measurement.
29
+ Non-Bash remainder includes tools, hooks, scheduling, and reasoning; do not
30
+ label it as model latency without another measurement.
22
31
 
23
- Use `--project .` to filter by the current repository's privacy-preserving project hash, or `--project <display-name-or-id>` for another entry. Use `--json` when feeding a dashboard or `/retro`.
32
+ Use `--project .` for this repo or another name/id as needed. Use `--json` for
33
+ dashboards or `/retro`.