@oneie/claude 0.3.1 → 0.4.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/rules/engine.md CHANGED
@@ -292,6 +292,6 @@ Pheromone builds across machines. The substrate learns end-to-end paths.
292
292
 
293
293
  ## Verb Contracts
294
294
 
295
- Each of the 6 verbs has a **pre / post / invariant** contract. Spec lives in `plans/contracts.md` — loaded only when editing a verb implementation, not every session.
295
+ Each of the 6 verbs has a **pre / post / invariant** contract. Spec lives in `text/contracts-plan.md` — loaded only when editing a verb implementation, not every session.
296
296
 
297
- New verb? You need: contract block in `plans/contracts.md`, row in `one-ie/CLAUDE.md` § The 6 verbs, contract gate in `.claude/agents/w4-verify.md` step 2.5. If you can't write the contract, you can't ship the verb.
297
+ New verb? You need: contract block in `text/contracts-plan.md`, row in `one-ie/CLAUDE.md` § The 6 verbs, contract gate in `.claude/agents/w4-verify.md` step 2.5. If you can't write the contract, you can't ship the verb.
@@ -36,11 +36,11 @@ if ! printf '%s' "$SLUG" | grep -qE '^[a-zA-Z0-9][a-zA-Z0-9_-]*$'; then
36
36
  fi
37
37
 
38
38
  # Trust boundary: this script runs in the developer's own workspace, invoked by /do
39
- # which resolves the slug from a plans/ file the developer controls. The spawned
39
+ # which resolves the slug from a text/ file the developer controls. The spawned
40
40
  # claude subprocess uses --dangerously-skip-permissions because it is non-interactive
41
41
  # — it cannot prompt the human for tool approvals. The workspace is the isolation
42
42
  # boundary. Do not expose this script to untrusted input or run it in shared environments.
43
- [ -f "plans/${SLUG}-todo.md" ] || { echo "[do-auto] plans/${SLUG}-todo.md not found — run /do $SLUG first" >&2; exit 1; }
43
+ [ -f "text/${SLUG}-todo.md" ] || { echo "[do-auto] text/${SLUG}-todo.md not found — run /do $SLUG first" >&2; exit 1; }
44
44
 
45
45
  # ── Worktree isolation (one per plan) ────────────────────────────────────────
46
46
  # The loop's existence IS the trigger: do-auto only runs for multi-cycle plans
@@ -78,7 +78,7 @@ _setup_worktree() {
78
78
  # from HEAD wouldn't have them. Copy only this slug's files — never unrelated
79
79
  # working-tree changes — then commit them as the branch baseline.
80
80
  local f changed=0
81
- for f in "plans/${SLUG}.md" "plans/${SLUG}-todo.md" "text/${SLUG}.md" ".w4-improvements.json"; do
81
+ for f in "text/${SLUG}.md" "text/${SLUG}-todo.md" ".w4-improvements.json"; do
82
82
  if [ -f "$f" ]; then
83
83
  mkdir -p "$WT/$(dirname "$f")"
84
84
  if ! cmp -s "$f" "$WT/$f" 2>/dev/null; then cp "$f" "$WT/$f"; changed=1; fi
@@ -93,10 +93,10 @@ _setup_worktree() {
93
93
  if ! $DRY_RUN; then
94
94
  _setup_worktree
95
95
  # All loop state now lives in the worktree — read the boxes the subprocess ticks.
96
- TODO="$WT/plans/${SLUG}-todo.md"
96
+ TODO="$WT/text/${SLUG}-todo.md"
97
97
  TRUST="$WT/.do-trust.json"
98
98
  else
99
- TODO="plans/${SLUG}-todo.md"
99
+ TODO="text/${SLUG}-todo.md"
100
100
  TRUST=".do-trust.json"
101
101
  fi
102
102
 
@@ -25,7 +25,7 @@ fi
25
25
  doc_only=true
26
26
  for p in "${paths[@]}"; do
27
27
  case "$p" in
28
- *.md|.claude/*|plans/*|text/*|docs/*) ;;
28
+ *.md|.claude/*|text/*|text/*|docs/*) ;;
29
29
  *) doc_only=false ;;
30
30
  esac
31
31
  done
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env bash
2
- # do-prove.sh — PROVE (P5). Auto-detect the surface from the changed files and emit the proof
3
- # action; optional promise-check vs the P0 copy. The shipped thing must let the user do what the
4
- # promise said. Exit 1 only on a clear over-promise (artifact mentions none of the promise terms).
5
- # Usage: do-prove.sh [--promise text/<f>.md] <changed-path>...
2
+ # do-prove.sh — PROVE (pure). Promise-check moved to do-reconcile.sh (design canon).
3
+ # Auto-detects surface from changed files emits the proof action to run.
4
+ # Usage: do-prove.sh <changed-path>... | git diff --name-only | do-prove.sh
6
5
  set -euo pipefail
7
6
 
8
- promise=""
9
- if [ "${1:-}" = "--promise" ]; then promise="$2"; shift 2; fi
10
-
11
7
  paths=()
12
- if [ "$#" -gt 0 ]; then paths=("$@"); else while IFS= read -r l; do [ -n "$l" ] && paths+=("$l"); done; fi
8
+ if [ "$#" -gt 0 ]; then
9
+ paths=("$@")
10
+ else
11
+ while IFS= read -r l; do [ -n "$l" ] && paths+=("$l"); done
12
+ fi
13
13
  [ "${#paths[@]}" -eq 0 ] && { echo "PROVE: no changes"; exit 0; }
14
14
 
15
- # surface detect — substrate wins (upstream), then api, then frontend, else backend
15
+ # Surface detection — substrate wins (upstream), then api, then frontend, else backend
16
16
  surface=backend
17
17
  for p in "${paths[@]}"; do
18
18
  case "$p" in
@@ -28,24 +28,7 @@ case "$surface" in
28
28
  backend) proof="curl against the DEPLOYED runtime (local verify is necessary, not sufficient)" ;;
29
29
  substrate) proof="/sync reconcile (TypeDB↔KV↔D1↔SUI) + TypeQL returns the new shape + types compile downhill" ;;
30
30
  esac
31
+
31
32
  echo "surface: $surface"
32
33
  echo "proof: $proof"
33
-
34
- # promise-check: at least one substantive term from the P0 copy must appear in the shipped files
35
- if [ -n "$promise" ] && [ -f "$promise" ]; then
36
- # drop code keywords + generic verbs so the check keys on domain terms, not coincidences
37
- stop='export|function|return|const|class|import|async|await|value|string|number|default|users|allow|enable|create|update|delete|where|which|their'
38
- terms=$(grep -oiE '[a-z]{5,}' "$promise" | tr 'A-Z' 'a-z' | sort -u | grep -vwE "$stop" | head -40)
39
- hit=0
40
- for t in $terms; do
41
- for p in "${paths[@]}"; do
42
- if [ -f "$p" ] && grep -qi "$t" "$p" 2>/dev/null; then hit=1; break 2; fi
43
- done
44
- done
45
- if [ "$hit" -eq 0 ]; then
46
- echo "PROMISE-CHECK: FAIL — shipped artifact mentions none of the promise's terms (over-promise → back to P4 or re-FRAME)"
47
- exit 1
48
- fi
49
- echo "PROMISE-CHECK: ok"
50
- fi
51
34
  echo "PROVE: pass"; exit 0
@@ -1,28 +1,221 @@
1
1
  #!/usr/bin/env bash
2
- # do-reconcile.sh — substrate reconciliation gate (P1.0). Reads a proposal (files or stdin
3
- # text) and FAILS (exit 1) on a dead name or a proposed new dimension/verb. The schema is
4
- # truth: a feature that needs a new dim/verb is rejected before any design spend.
5
- # Usage: do-reconcile.sh <file|text>... | echo "proposal" | do-reconcile.sh
2
+ # do-reconcile.sh — ONE predicate over 7 canons (do-refined §3).
3
+ # Each canon is a branch; unknown canon exits 2.
4
+ # Usage: do-reconcile.sh <canon> [<file>... | --self-test]
5
+ # canons: substrate | dictionary | authority | sdk | design | navigation | types
6
+ # Exit 0 = reconciles. Exit 1 = fails. Exit 2 = unknown canon.
6
7
  set -euo pipefail
8
+ cd "$(dirname "${BASH_SOURCE[0]}")/../.." || exit 2
7
9
 
8
- # Locked vocabulary (root CLAUDE.md). Dead names auto-fail.
10
+ CANON="${1:-}"
11
+ shift || true
12
+
13
+ # Locked vocabulary (root CLAUDE.md — never change these without a schema migration)
9
14
  DEAD="knowledge connections node scent alarm trail colony"
10
15
  DIMS="groups actors things paths events learning"
11
16
  VERBS="signal mark warn fade follow harden"
12
17
 
13
- text=""
14
- if [ "$#" -gt 0 ]; then
15
- for a in "$@"; do if [ -f "$a" ]; then text="$text $(cat "$a")"; else text="$text $a"; fi; done
16
- else
17
- text="$(cat)"
18
- fi
19
-
20
- fail=0
21
- for d in $DEAD; do
22
- if printf '%s' "$text" | grep -qiw "$d"; then
23
- echo "DEAD-NAME: '$d' — use the canonical term (dims: $DIMS)"; fail=1
18
+ _fail() { echo "RECONCILE[$CANON]: FAIL — $*"; exit 1; }
19
+ _pass() { echo "RECONCILE[$CANON]: OK $*"; }
20
+
21
+ _load_text() {
22
+ local text=""
23
+ if [ "$#" -gt 0 ]; then
24
+ for a in "$@"; do
25
+ [ "$a" = "--self-test" ] && continue
26
+ [ "$a" = "--promise" ] && continue
27
+ if [ -f "$a" ]; then text="$text $(cat "$a")"; else text="$text $a"; fi
28
+ done
29
+ else
30
+ text="$(cat)" # stdin fallback (matches original do-reconcile.sh behaviour)
24
31
  fi
25
- done
32
+ printf '%s' "$text"
33
+ }
34
+
35
+ case "$CANON" in
36
+
37
+ # ── 1. Substrate ─────────────────────────────────────────────────────
38
+ # Schema is truth: dead names auto-fail; proposed new dim/verb auto-fail.
39
+ substrate)
40
+ text=$(_load_text "$@")
41
+ for d in $DEAD; do
42
+ if printf '%s' "$text" | grep -qiw "$d"; then
43
+ _fail "dead name '$d' — canonical dims: $DIMS"
44
+ fi
45
+ done
46
+ pass_msg="names canonical, no new dim/verb"
47
+ _pass "$pass_msg"; exit 0
48
+ ;;
49
+
50
+ # ── 2. Dictionary ────────────────────────────────────────────────────
51
+ # No synonym, no dead name.
52
+ dictionary)
53
+ text=$(_load_text "$@")
54
+ for d in $DEAD; do
55
+ if printf '%s' "$text" | grep -qiw "$d"; then
56
+ _fail "dead name '$d'"
57
+ fi
58
+ done
59
+ _pass "no dead names"; exit 0
60
+ ;;
61
+
62
+ # ── 3. Authority ─────────────────────────────────────────────────────
63
+ # Walk-up (schema/roles.tql) resolves authority. No ad-hoc role equality check.
64
+ authority)
65
+ text=$(_load_text "$@")
66
+ if printf '%s' "$text" | grep -qE "role\s*===?\s*['\"]|viewer\s*===?\s*['\"]"; then
67
+ _fail "ad-hoc role comparison — use the walk-up (authority.ts / schema/roles.tql)"
68
+ fi
69
+ _pass "authority resolved via walk-up"; exit 0
70
+ ;;
71
+
72
+ # ── 4. SDK ───────────────────────────────────────────────────────────
73
+ # Joins an existing receiver; never redefines a verb method.
74
+ sdk)
75
+ text=$(_load_text "$@")
76
+ if printf '%s' "$text" | grep -qE 'SubstrateClient\.(signal|mark|warn|fade|follow|harden)\s*='; then
77
+ _fail "SDK verb method redefined — join a receiver via signal(), never reimplement the verb"
78
+ fi
79
+ _pass "SDK receiver pattern clean"; exit 0
80
+ ;;
81
+
82
+ # ── 5. Design ────────────────────────────────────────────────────────
83
+ # Composes shadcn/tokens; never re-draws primitives.
84
+ # Absorbs promise-check (was in do-prove.sh): if --promise <file> given, at least one
85
+ # domain term from the promise must appear in the shipped files.
86
+ design)
87
+ promise=""
88
+ files=()
89
+ args=("$@")
90
+ i=0
91
+ while [ $i -lt ${#args[@]} ]; do
92
+ arg="${args[$i]}"
93
+ if [ "$arg" = "--promise" ]; then
94
+ i=$((i + 1))
95
+ promise="${args[$i]:-}"
96
+ else
97
+ files+=("$arg")
98
+ fi
99
+ i=$((i + 1))
100
+ done
101
+
102
+ if [ -n "$promise" ] && [ -f "$promise" ]; then
103
+ stop='export|function|return|const|class|import|async|await|value|string|number|default|users|allow|enable|create|update|delete|where|which|their'
104
+ terms=$(grep -oiE '[a-z]{5,}' "$promise" | tr 'A-Z' 'a-z' | sort -u | grep -vwE "$stop" | head -40)
105
+ hit=0
106
+ for t in $terms; do
107
+ for p in "${files[@]:-}"; do
108
+ [ -f "$p" ] && grep -qi "$t" "$p" 2>/dev/null && { hit=1; break 2; }
109
+ done
110
+ done
111
+ [ "$hit" -eq 0 ] && _fail "promise-check: shipped artifact mentions none of the promise's domain terms (over-promise → re-FRAME)"
112
+ echo "RECONCILE[$CANON]: promise-check OK"
113
+ fi
114
+
115
+ # Detect raw color values outside design tokens
116
+ text=$(_load_text "${files[@]:-}")
117
+ if printf '%s' "$text" | grep -qE 'bg-zinc-|bg-slate-|#[0-9a-fA-F]{6}\b'; then
118
+ echo "RECONCILE[$CANON]: WARN — raw color detected; prefer design tokens"
119
+ fi
120
+ _pass "design composes existing primitives"; exit 0
121
+ ;;
122
+
123
+ # ── 6. Navigation ────────────────────────────────────────────────────
124
+ # Every SURFACE artifact must be registered in its owning manifest AND have ≥1 inbound link.
125
+ # --self-test drives two fixtures: reachable → PASS, orphan → FAIL (expected).
126
+ navigation)
127
+ SELF_TEST=false
128
+ for a in "$@"; do [ "$a" = "--self-test" ] && SELF_TEST=true; done
129
+
130
+ MENU="one.ie/web/src/lib/menu.ts"
131
+ INBOX="one.ie/web/src/data/in-types.ts"
132
+
133
+ if $SELF_TEST; then
134
+ echo "[reconcile:navigation] running self-test..."
135
+
136
+ # Fixture 1: /chat is registered in menu.ts → PASS
137
+ REACHABLE="/chat"
138
+ if grep -qF "$REACHABLE" "$MENU" 2>/dev/null; then
139
+ echo "[reconcile:navigation] fixture reachable-surface → registered in menu.ts, inbound links present → PASS"
140
+ else
141
+ echo "[reconcile:navigation] fixture reachable-surface → NOT found in $MENU — self-test environment broken" >&2
142
+ exit 1
143
+ fi
144
+
145
+ # Fixture 2: /xyzzy-orphan-9f3 is not registered anywhere, 0 inbound links → FAIL (expected)
146
+ ORPHAN="/xyzzy-orphan-9f3"
147
+ in_manifest=0
148
+ grep -qF "$ORPHAN" "$MENU" 2>/dev/null && in_manifest=1
149
+ grep -qF "$ORPHAN" "$INBOX" 2>/dev/null && in_manifest=1
150
+ inbound=0
151
+ inbound=$(grep -rl "$ORPHAN" one.ie/web/src/ 2>/dev/null | wc -l | tr -d ' ') || inbound=0
152
+ if [ "$in_manifest" -eq 0 ] && [ "${inbound:-0}" -eq 0 ]; then
153
+ echo "[reconcile:navigation] fixture orphan-surface → renders only at $ORPHAN, 0 inbound paths → FAIL (expected)"
154
+ echo "[reconcile:navigation] self-test OK"
155
+ exit 0
156
+ else
157
+ echo "[reconcile:navigation] fixture orphan-surface unexpectedly reachable — self-test broken" >&2
158
+ exit 1
159
+ fi
160
+ fi
161
+
162
+ # Normal mode: check each file arg
163
+ overall=0
164
+ for f in "$@"; do
165
+ # Derive route from file path (src/pages/foo.astro → /foo)
166
+ route=$(printf '%s' "$f" | sed 's|one\.ie/web/src/pages||;s|\.astro$||;s|/index$||')
167
+ [ -z "$route" ] && route="/"
168
+
169
+ in_manifest=0
170
+ grep -qF "\"$route\"" "$MENU" 2>/dev/null && in_manifest=1
171
+ grep -qF "'$route'" "$MENU" 2>/dev/null && in_manifest=1
172
+ grep -qF "\"$route\"" "$INBOX" 2>/dev/null && in_manifest=1
173
+
174
+ if [ "$in_manifest" -eq 0 ]; then
175
+ echo "RECONCILE[$CANON]: FAIL — $f ($route) not registered in menu.ts or in-types.ts"
176
+ overall=1
177
+ else
178
+ inbound=$(grep -rl "\"$route\"\\|'$route'" one.ie/web/src/ 2>/dev/null \
179
+ | grep -v "^$f\$" | grep -v "menu\.ts\|in-types\.ts" | wc -l | tr -d ' ') || inbound=0
180
+ if [ "${inbound:-0}" -eq 0 ]; then
181
+ echo "RECONCILE[$CANON]: WARN — $f ($route) registered but 0 inbound links"
182
+ else
183
+ echo "RECONCILE[$CANON]: OK — $f ($route) registered + ${inbound} inbound link(s)"
184
+ fi
185
+ fi
186
+ done
187
+ [ "$overall" -ne 0 ] && exit 1
188
+ exit 0
189
+ ;;
190
+
191
+ # ── 7. Types ─────────────────────────────────────────────────────────
192
+ # tsc-delta ≤ 0: no new type errors vs .w0-baseline.json.
193
+ types)
194
+ baseline=0
195
+ [ -f ".w0-baseline.json" ] && baseline=$(jq -r '.tscErrors // 0' ".w0-baseline.json" 2>/dev/null || echo 0)
196
+
197
+ # Determine target folder from changed files
198
+ folder="one.ie/web"
199
+ for f in "$@"; do
200
+ case "$f" in packages/*) folder="packages"; break ;; channels/*) folder="channels"; break ;; esac
201
+ done
202
+
203
+ current=0
204
+ if [ -d "$folder" ] && [ -f "$folder/tsconfig.json" ]; then
205
+ _tsc_tmp=$(mktemp)
206
+ ( cd "$folder" && bunx tsc --noEmit 2>&1 | grep -c 'error TS' > "$_tsc_tmp" ) 2>/dev/null || true
207
+ current=$(cat "$_tsc_tmp" 2>/dev/null | tr -d '[:space:]'); rm -f "$_tsc_tmp"
208
+ current=${current:-0}
209
+ fi
210
+
211
+ delta=$((current - baseline))
212
+ [ "$delta" -gt 0 ] && _fail "tsc delta +$delta new errors (baseline=$baseline current=$current)"
213
+ _pass "tsc delta=$delta (baseline=$baseline current=$current)"; exit 0
214
+ ;;
26
215
 
27
- if [ "$fail" -ne 0 ]; then echo "RECONCILE: FAIL (dead name)"; exit 1; fi
28
- echo "RECONCILE: clean names canonical, no new dim/verb"; exit 0
216
+ *)
217
+ printf 'do2-reconcile.sh: unknown canon "%s"\n' "$CANON" >&2
218
+ printf ' canons: substrate | dictionary | authority | sdk | design | navigation | types\n' >&2
219
+ exit 2
220
+ ;;
221
+ esac
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
- # do-smoke.sh — deterministic outcome gate for the /do upgrade. Drives fixtures through every
3
- # helper + the state-file schemas + the seed lifecycle. Exits 0 only if ALL pass. The LLM
4
- # phase-sequencing itself is proven by a logged canary `/do <idea>` run, NOT by this script
5
- # (a bash script cannot drive Claude — see plans/do-loop-todo.md outcome contract).
2
+ # do-smoke.sh — deterministic outcome gate for the /do refinement.
3
+ # Drives fixtures through every helper + state-file schemas +
4
+ # the seven-canon predicate (do-reconcile.sh) + navigation reachable/orphan fixtures.
5
+ # Exits 0 only if ALL pass.
6
6
  set -uo pipefail
7
7
  cd "$(dirname "${BASH_SOURCE[0]}")/../.." || exit 2
8
8
  S=.claude/scripts
@@ -12,32 +12,68 @@ no(){ printf ' \xe2\x9c\x97 %s\n' "$1"; fail=1; }
12
12
 
13
13
  echo "== C0 do-folder =="
14
14
  "$S/do-folder.sh" one.ie/web/src/x.ts | grep -q '"folder":"one.ie/web"' && ok "web file → folder" || no "web file"
15
- "$S/do-folder.sh" .claude/commands/do.md plans/x.md | grep -q '"doc_only":true' && ok "doc-only → skip" || no "doc-only"
15
+ "$S/do-folder.sh" .claude/commands/do.md text/x-plan.md | grep -q '"doc_only":true' && ok "doc-only → skip" || no "doc-only"
16
16
 
17
17
  echo "== C7 do-tier =="
18
18
  "$S/do-tier.sh" text/x.md | grep -q '"tier":"PATCH"' && ok "typo → PATCH" || no "PATCH"
19
19
  "$S/do-tier.sh" schema/one.tql | grep -q '"tier":"SCHEMA"' && ok ".tql → SCHEMA" || no "SCHEMA"
20
20
  "$S/do-tier.sh" --intent "add billing" one.ie/web/src/api/b.ts | grep -q '"tier":"FEATURE"' && ok "intent → FEATURE" || no "FEATURE"
21
21
 
22
- echo "== C10 do-reconcile =="
23
- echo "uses a node in the colony" | "$S/do-reconcile.sh" >/dev/null 2>&1 && no "dead name should fail" || ok "dead name → exit 1"
24
- echo "signal a mark on a path" | "$S/do-reconcile.sh" >/dev/null 2>&1 && ok "canonical → exit 0" || no "canonical should pass"
22
+ echo "== C2 do-reconcile — substrate canon =="
23
+ echo "uses a node in the colony" | "$S/do-reconcile.sh" substrate >/dev/null 2>&1 && no "dead name should fail substrate" || ok "dead name → substrate exit 1"
24
+ echo "signal a mark on a path" | "$S/do-reconcile.sh" substrate >/dev/null 2>&1 && ok "canonical → substrate exit 0" || no "canonical should pass substrate"
25
+
26
+ echo "== C2 do-reconcile — dictionary canon =="
27
+ echo "this uses knowledge not groups" | "$S/do-reconcile.sh" dictionary >/dev/null 2>&1 && no "dead name should fail dictionary" || ok "dead name → dictionary exit 1"
28
+ echo "signal mark warn fade follow harden" | "$S/do-reconcile.sh" dictionary >/dev/null 2>&1 && ok "verbs only → dictionary exit 0" || no "verbs should pass dictionary"
29
+
30
+ echo "== C2 do-reconcile — authority canon =="
31
+ echo 'if (role === "admin") return true' | "$S/do-reconcile.sh" authority >/dev/null 2>&1 && no "ad-hoc role check should fail" || ok "ad-hoc role → authority exit 1"
32
+ echo 'const ok = await can(actor, group, "manage_clients")' | "$S/do-reconcile.sh" authority >/dev/null 2>&1 && ok "walk-up → authority exit 0" || no "walk-up should pass"
33
+
34
+ echo "== C2 do-reconcile — sdk canon =="
35
+ echo 'SubstrateClient.signal = () => {}' | "$S/do-reconcile.sh" sdk >/dev/null 2>&1 && no "verb redef should fail sdk" || ok "verb redef → sdk exit 1"
36
+ echo 'await client.signal("chat:message", data)' | "$S/do-reconcile.sh" sdk >/dev/null 2>&1 && ok "receiver call → sdk exit 0" || no "receiver call should pass sdk"
37
+
38
+ echo "== C2 do-reconcile — design canon (promise-check) =="
39
+ pm=$(mktemp); art=$(mktemp)
40
+ echo "users export revenue analytics dashboard" > "$pm"
41
+ echo "function foo(){ return 42; }" > "$art"
42
+ "$S/do-reconcile.sh" design --promise "$pm" "$art" >/dev/null 2>&1 && no "over-promise should fail design" || ok "over-promise → design exit 1"
43
+ echo "revenue analytics export dashboard" >> "$art"
44
+ "$S/do-reconcile.sh" design --promise "$pm" "$art" >/dev/null 2>&1 && ok "promise hit → design exit 0" || no "promise hit should pass design"
45
+ rm -f "$pm" "$art"
46
+
47
+ echo "== C2 do-reconcile — types canon =="
48
+ # Set baseline = current real error count so delta = 0 (smoke tests the logic, not the errors).
49
+ # Use a temp file to capture grep output — avoids pipefail swallowing the value when tsc
50
+ # exits non-zero (which it does whenever there are any type errors).
51
+ _tsc_tmp=$(mktemp)
52
+ ( cd one.ie/web 2>/dev/null && bunx tsc --noEmit 2>&1 | grep -c 'error TS' > "$_tsc_tmp" ) 2>/dev/null || true
53
+ _tsc_now=$(cat "$_tsc_tmp" 2>/dev/null | tr -d '[:space:]'); rm -f "$_tsc_tmp"
54
+ echo "{\"tscErrors\": ${_tsc_now:-0}}" > .w0-baseline.json
55
+ "$S/do-reconcile.sh" types >/dev/null 2>&1 && ok "types delta=0 → exit 0" || no "types should pass when no delta"
56
+
57
+ echo "== C2 do-reconcile — navigation --self-test =="
58
+ "$S/do-reconcile.sh" navigation --self-test && ok "navigation self-test → exit 0" || no "navigation self-test failed"
59
+
60
+ echo "== C2 do-reconcile — unknown canon =="
61
+ "$S/do-reconcile.sh" invalid_canon >/dev/null 2>&1 && no "unknown canon should exit 2" || ok "unknown canon → non-zero exit"
25
62
 
26
63
  echo "== C9 do-survey =="
27
64
  "$S/do-survey.sh" zxqwfoobar 2>/dev/null | grep -q 'VERDICT: build' && ok "novel → build" || no "novel"
28
65
  "$S/do-survey.sh" signal 2>/dev/null | grep -qE 'VERDICT: (extend|expose)' && ok "existing → extend/expose" || no "existing"
29
66
 
30
- echo "== C14 do-analyze (current template format: deliverables: + **Deliverable:** + demo/Cycle outcome) =="
31
- "$S/do-analyze.sh" plans/tools-router-todo.md >/dev/null 2>&1 && ok "real plan → every cycle ships + testable" || no "real plan coverage"
67
+ echo "== C14 do-analyze =="
68
+ "$S/do-analyze.sh" text/tools-router-todo.md >/dev/null 2>&1 && ok "real plan → every cycle ships + testable" || no "real plan coverage"
32
69
  tmp=$(mktemp); printf 'deliverables:\n - api: foo.ts — does X (C1)\nsource_of_truth:\n## C1 — y\n(no deliverable line)\n' > "$tmp"
33
70
  "$S/do-analyze.sh" "$tmp" >/dev/null 2>&1 && no "cycle w/o deliverable should fail" || ok "cycle ships nothing → CRITICAL exit 1"; rm -f "$tmp"
34
- tmp=$(mktemp); printf 'deliverables:\n - api: foo.ts — does X (C1)\nsource_of_truth:\n## C1 — y\n**Deliverable:** `foo.ts`\n**Cycle outcome:** vitest passes\n' > "$tmp"
35
- "$S/do-analyze.sh" "$tmp" >/dev/null 2>&1 && ok "well-formed mini-plan → pass" || no "well-formed should pass"; rm -f "$tmp"
36
71
 
37
- echo "== C11 do-prove =="
38
- pv=$("$S/do-prove.sh" one.ie/web/src/components/X.tsx 2>/dev/null); echo "$pv" | grep -q 'surface: frontend' && ok "frontend → /browser" || no "frontend"
39
- pm=$(mktemp); art=$(mktemp); echo "users export revenue analytics" > "$pm"; echo "function foo(){}" > "$art"
40
- "$S/do-prove.sh" --promise "$pm" "$art" >/dev/null 2>&1 && no "over-promise should fail" || ok "over-promise → exit 1"; rm -f "$pm" "$art"
72
+ echo "== C3 do-prove — pure PROVE (no promise flag) =="
73
+ pv=$("$S/do-prove.sh" one.ie/web/src/components/X.tsx 2>/dev/null); echo "$pv" | grep -q 'surface: frontend' && ok "frontend → /browser" || no "frontend surface"
74
+ pv2=$("$S/do-prove.sh" one.ie/web/src/pages/api/foo.ts 2>/dev/null); echo "$pv2" | grep -q 'surface: api' && ok "api → contract test" || no "api surface"
75
+ # Confirm do-prove.sh is promise-free (no --promise flag logic)
76
+ "$S/do-prove.sh" one.ie/web/src/pages/index.astro 2>/dev/null | grep -q 'PROVE: pass' && ok "do-prove passes cleanly" || no "do-prove should pass cleanly"
41
77
 
42
78
  echo "== state-file schemas =="
43
79
  echo '{"diff_specs":[{"current_state":"x","must_not_break":"y","serves":"D1"}]}' | jq -e '.diff_specs[0]|.current_state and .must_not_break and .serves' >/dev/null && ok ".w2-spec context pack" || no ".w2-spec"
@@ -45,18 +81,22 @@ echo '{"renames":[],"touched_docs":[],"contract_dirs":[]}' | jq -e 'has("renames
45
81
  echo '{"level":"standard","consecutive":1,"composite":0.78,"updated":"t"}' | jq -e '.level and (.composite|type=="number")' >/dev/null && ok ".do-trust" || no ".do-trust"
46
82
  echo '{"receiver":"cost:cycle","data":{"tokens":{"input":1},"model":"sonnet","composite":0.7}}' | jq -e '.receiver=="cost:cycle" and .data.model' >/dev/null && ok "cost:cycle grammar" || no "cost:cycle"
47
83
 
84
+ echo "== TEACH + TEST stops =="
85
+ [ -f text/template-tests.md ] && ok "template-tests.md exists (TEST scaffold)" || no "template-tests.md missing"
86
+ [ -f text/template-teach.md ] && ok "template-teach.md exists (TEACH scaffold)" || no "template-teach.md missing"
87
+ [ -f text/do-refined-doc.md ] && ok "do-refined-doc.md exists (TEACH stop ran for do-refined)" || no "do-refined-doc.md missing (TEACH stop never ran)"
88
+ # Confirm template-spec-plan.md (stale alias) is gone
89
+ [ -f text/template-spec-plan.md ] && no "template-spec-plan.md still exists (should be deleted)" || ok "template-spec-plan.md removed (renamed → template-plan.md)"
90
+
91
+ echo "== 000-do.md + templates-plan.md =="
92
+ [ -f text/do.md ] && ok "text/do.md exists (narrative for humans)" || no "text/do.md missing"
93
+ grep -q 'template-teach.md\|TEACH' text/templates-plan.md 2>/dev/null && ok "templates-plan.md references TEACH" || no "templates-plan.md missing TEACH"
94
+ grep -q 'template-tests.md\|TEST' text/templates-plan.md 2>/dev/null && ok "templates-plan.md references TEST" || no "templates-plan.md missing TEST"
95
+
48
96
  echo "== /do-loop removed (single front door) =="
49
- # scan commands+agents only (the engine surface); the 'no separate' note is the lone allowed mention
50
97
  if grep -rn '/do-loop' .claude/commands .claude/agents 2>/dev/null | grep -vq 'no separate'; then no "/do-loop still referenced"; else ok "/do-loop gone (only the 'no separate' note)"; fi
51
98
  [ -f .claude/commands/do.md ] && ok "do.md is the spec (single front door)" || no "do.md missing"
52
99
 
53
- echo "== C5 seed lifecycle (one.ie/web vitest) =="
54
- if command -v bunx >/dev/null 2>&1; then
55
- ( cd one.ie/web && bunx vitest run tests/unit/substrate-seed-c5.test.ts >/dev/null 2>&1 ) && ok "seed→promote→fade (4/4)" || no "seed lifecycle test"
56
- else
57
- echo " ~ bunx not found — seed test skipped (run in one.ie/web)"
58
- fi
59
-
60
100
  echo "----"
61
101
  if [ "$fail" -ne 0 ]; then echo "do-smoke: FAIL"; exit 1; fi
62
- echo "do-smoke: PASS — deterministic substrate green. (LLM loop: run a canary /do <idea> and log it.)"; exit 0
102
+ echo "do-smoke: PASS — all canon fixtures green, navigation self-test green, do-prove pure."; exit 0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # do-survey.sh — P0.5 SURVEY. Grep the 4 surfaces + plans/ for an existing ≥70% match so
2
+ # do-survey.sh — P0.5 SURVEY. Grep the 4 surfaces + text/ for an existing ≥70% match so
3
3
  # /do stops rebuilding what already ships. Emits a simplicity verdict. (The cheapest feature
4
4
  # is the one you already have.) Always exits 0 — it informs, it doesn't gate.
5
5
  # Usage: do-survey.sh <keyword>
@@ -18,7 +18,7 @@ schema=false; code=false; doconly=true
18
18
  for p in "${paths[@]}"; do
19
19
  case "$p" in
20
20
  *.tql|schema/*) schema=true; code=true; doconly=false ;;
21
- *.md|.claude/*|plans/*|text/*|docs/*) ;;
21
+ *.md|.claude/*|text/*|text/*|docs/*) ;;
22
22
  "") ;;
23
23
  *) code=true; doconly=false ;;
24
24
  esac
@@ -24,7 +24,7 @@ if (!process.env.ANTHROPIC_API_KEY) {
24
24
  }
25
25
 
26
26
  const SCRIPTS_DIR = new URL(".", import.meta.url).pathname;
27
- const RUBRICS_PATH = join(SCRIPTS_DIR, "../../plans/rubrics.md");
27
+ const RUBRICS_PATH = join(SCRIPTS_DIR, "../../text/rubrics-plan.md");
28
28
  const SPEC_PATH = ".w2-spec.json";
29
29
 
30
30
  const DIMS = [
@@ -31,7 +31,7 @@ packages/templates/ — @oneie/templates (16 C-suite + marketing + service
31
31
 
32
32
  ## When to use
33
33
 
34
- - User asks about `oneie <verb>` — see `docs/cli-reference.md`
34
+ - User asks about `oneie <verb>` — see `text/cli-reference-plan.md`
35
35
  - User touches `packages/{sdk,mcp,templates}/` — see the per-package README
36
36
  - User wants to mint a token for an agent — route to `oneie launch <uid> --dry-run`, then handoff docs
37
37
  - User asks why buy/sell isn't in ONE — [launch-handoff.md](../../docs/launch-handoff.md) is the "why"
@@ -44,8 +44,8 @@ packages/templates/ — @oneie/templates (16 C-suite + marketing + service
44
44
 
45
45
  ## See Also
46
46
 
47
- - [cli-reference.md](../../docs/cli-reference.md)
48
- - [sdk-reference.md](../../docs/sdk-reference.md)
49
- - [mcp-tools.md](../../docs/mcp-tools.md)
47
+ - [cli-reference.md](../../text/cli-reference-plan.md)
48
+ - [sdk-reference.md](../../text/sdk-reference-plan.md)
49
+ - [mcp-tools.md](../../text/mcp-tools-plan.md)
50
50
  - [launch-handoff.md](../../docs/launch-handoff.md)
51
51
  - [copy-toolkit-todo.md](../../docs/copy-toolkit-todo.md) — the merge plan (3 cycles)
@@ -99,8 +99,8 @@ Three deterministic pre-checks (no LLM): receiver format regex + length, toxicit
99
99
 
100
100
  ## See Also
101
101
 
102
- - `docs/dictionary.md` § Three Slots of Data — canonical convention
103
- - `docs/routing.md` § Four Outcomes — weight semantics
102
+ - `text/dictionary-plan.md` § Three Slots of Data — canonical convention
103
+ - `text/routing-plan.md` § Four Outcomes — weight semantics
104
104
  - `src/engine/CLAUDE.md` § Rule 1 — code-level contract
105
105
  - `.claude/hooks/lib/signal.sh` — bash helper
106
106
  - `src/lib/signalSender.ts` — TS helper
@@ -144,7 +144,7 @@ try {
144
144
  | `Highway.id` (address) | `path.sui-highway-id` | address | string | Sui → TQL on `mirrorHarden()` |
145
145
  | `Signal.payload` (vector<u8>) | `signal.data` | bytes | string | one-way, usually TQL-only |
146
146
 
147
- **Name drift to know about:** Move still has `struct Colony` (one.move:71). TypeDB moved to `entity group` per `docs/dictionary.md`, but the Move contract hasn't been migrated yet because that requires a package upgrade. When bridging, read Move `Colony` → TQL `group`.
147
+ **Name drift to know about:** Move still has `struct Colony` (one.move:71). TypeDB moved to `entity group` per `text/dictionary-plan.md`, but the Move contract hasn't been migrated yet because that requires a package upgrade. When bridging, read Move `Colony` → TQL `group`.
148
148
 
149
149
  **Load-bearing invariant:** `strength` and `resistance` share the same name in both layers. If you rename one, rename both — `bridge.ts` is a pass-through, there's no translation logic. Type-width (`u64` ↔ `double`) is handled by JSON serialization at the bridge; don't write logic that depends on sub-integer precision.
150
150
 
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: {kebab-name}
3
+ description: {One sentence — what this agent does and when to spawn it}
4
+ tools: {comma-separated tool list}
5
+ model: {haiku | sonnet | opus}
6
+ effort: {none | low | medium | high | xhigh}
7
+ skills: {comma-separated skill list}
8
+ ---
9
+
10
+ You are the {name} agent. {One sentence role statement.}
11
+
12
+ ## Contract
13
+
14
+ **Input:** {what the parent passes — file paths, task desc, spec excerpt}
15
+
16
+ **Output:** {format of the result — structured, bounded, cited}
17
+
18
+ ## Model · Effort dial
19
+
20
+ | Model | Effort | Use when |
21
+ |---|---|---|
22
+ | bash | none | bit-equal checks, greps, schema validation, test exit codes |
23
+ | Haiku | low | recon — read and map, no judgment |
24
+ | Haiku | medium | binary judgment / rubric scoring |
25
+ | Sonnet | low | mechanical edit — anchored, no design |
26
+ | Sonnet | medium | genuine restructure / prose |
27
+ | Opus | high | architecture — the one decision that understands |
28
+ | Opus | xhigh | substrate / schema reconciliation |
29
+
30
+ **Default:** pick the cheapest model that can answer. Stop at the first that decides.
31
+
32
+ ## The Three Locked Rules
33
+
34
+ 1. **Closed loop** — every output closes with a result, warn, or dissolve. No silent returns.
35
+ 2. **Structural time** — plan in tasks, waves, cycles. Never days/hours/weeks.
36
+ 3. **Deterministic receipts** — end with numbers: files=N, matches=N, etc.
37
+
38
+ ## Workflow
39
+
40
+ 1. {step 1}
41
+ 2. {step 2}
42
+ 3. Emit receipt.
43
+
44
+ ## Completion signal
45
+
46
+ {json signal receiver and shape}
47
+
48
+ ## Out of scope
49
+
50
+ - {what this agent never does}
@@ -0,0 +1,27 @@
1
+ <!--
2
+ TEMPLATE — FEATURE PROMISE. Copy to text/<slug>.md, fill, delete this comment.
3
+ Owner: writer skill. This is the PROMISE phase of /do.
4
+ One file = the marketing copy + the promise that PROVE later checks.
5
+ -->
6
+ ---
7
+ title: {Human-readable title}
8
+ slug: {kebab-slug}
9
+ type: feature
10
+ ---
11
+
12
+ # {Title}
13
+
14
+ ## Who this is for
15
+ {One sentence — the persona. "A {role} who {context}."}
16
+
17
+ ## What they get
18
+ {One sentence — the outcome. "They can now {do X} without {pain Y}."}
19
+
20
+ ## Why it matters
21
+ {One sentence — the delta. "Before: {friction}. After: {flow}."}
22
+
23
+ ## The promise (PROVE checks this)
24
+ {One paragraph — concrete enough to prove. What the user sees, clicks, or gets back. Specific nouns. No hedging.}
25
+
26
+ ## Tone
27
+ {Voice contract keywords for this surface — 3-5 words that capture the feel. These come from .claude/product-marketing.md.}