@linimin/pi-letscook 0.1.37 → 0.1.40

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.
@@ -2,9 +2,51 @@
2
2
  set -euo pipefail
3
3
 
4
4
  PKG_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ pi() {
6
+ command pi --no-extensions "$@"
7
+ }
5
8
  TMPDIR="$(mktemp -d)"
6
9
  trap 'rm -rf "$TMPDIR"' EXIT
7
10
 
11
+ write_session() {
12
+ local session_path="$1"
13
+ local cwd="$2"
14
+ local text="$3"
15
+ python3 - "$session_path" "$cwd" "$text" <<'PY'
16
+ import json
17
+ import sys
18
+ from pathlib import Path
19
+
20
+ session_path = Path(sys.argv[1])
21
+ cwd = sys.argv[2]
22
+ text = sys.argv[3]
23
+ session_path.parent.mkdir(parents=True, exist_ok=True)
24
+ entries = [
25
+ {
26
+ "type": "session",
27
+ "version": 3,
28
+ "id": "11111111-1111-4111-8111-111111111111",
29
+ "timestamp": "2026-01-01T00:00:00.000Z",
30
+ "cwd": cwd,
31
+ },
32
+ {
33
+ "type": "message",
34
+ "id": "a1b2c3d4",
35
+ "parentId": None,
36
+ "timestamp": "2026-01-01T00:00:01.000Z",
37
+ "message": {
38
+ "role": "user",
39
+ "content": text,
40
+ "timestamp": 1767225601000,
41
+ },
42
+ },
43
+ ]
44
+ with session_path.open('w', encoding='utf-8') as fh:
45
+ for entry in entries:
46
+ fh.write(json.dumps(entry, ensure_ascii=False) + "\n")
47
+ PY
48
+ }
49
+
8
50
  cd "$PKG_ROOT"
9
51
 
10
52
  node <<'NODE'
@@ -46,12 +88,17 @@ NODE
46
88
 
47
89
  ROOT="$TMPDIR/repo"
48
90
  PROMPT="$TMPDIR/resume-prompt.txt"
91
+ BOOTSTRAP_SESSION="$TMPDIR/session-active-slice-bootstrap.jsonl"
92
+ BOOTSTRAP_DISCUSSION=$'Mission: Exercise active-slice contract parity.\nScope:\n- Bootstrap canonical completion files for the active-slice contract fixture.\nConstraints:\n- Use supported bare /cook startup only.\nAcceptance:\n- Materialize canonical files before the fixture rewrites them.'
49
93
  mkdir -p "$ROOT"
50
94
  cd "$ROOT"
51
95
  git init -q
96
+ write_session "$BOOTSTRAP_SESSION" "$ROOT" "$BOOTSTRAP_DISCUSSION"
52
97
 
98
+ PI_COMPLETION_CONTEXT_PROPOSAL_ACTION=accept \
99
+ PI_COMPLETION_DISABLE_CONTEXT_PROPOSAL_ANALYST=1 \
53
100
  PI_COMPLETION_SKIP_DRIVER_KICKOFF=1 \
54
- pi -e "$PKG_ROOT" -p "/cook active-slice contract fixture" \
101
+ pi --session "$BOOTSTRAP_SESSION" -e "$PKG_ROOT" -p "/cook" \
55
102
  >"$TMPDIR/pi-active-slice-bootstrap.out" 2>"$TMPDIR/pi-active-slice-bootstrap.err"
56
103
 
57
104
  python3 - <<'PY'
@@ -2,9 +2,51 @@
2
2
  set -euo pipefail
3
3
 
4
4
  PKG_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ pi() {
6
+ command pi --no-extensions "$@"
7
+ }
5
8
  TMPDIR="$(mktemp -d)"
6
9
  CURRENT_EVIDENCE_BACKUP=""
7
10
 
11
+ write_session() {
12
+ local session_path="$1"
13
+ local cwd="$2"
14
+ local text="$3"
15
+ python3 - "$session_path" "$cwd" "$text" <<'PY'
16
+ import json
17
+ import sys
18
+ from pathlib import Path
19
+
20
+ session_path = Path(sys.argv[1])
21
+ cwd = sys.argv[2]
22
+ text = sys.argv[3]
23
+ session_path.parent.mkdir(parents=True, exist_ok=True)
24
+ entries = [
25
+ {
26
+ "type": "session",
27
+ "version": 3,
28
+ "id": "11111111-1111-4111-8111-111111111111",
29
+ "timestamp": "2026-01-01T00:00:00.000Z",
30
+ "cwd": cwd,
31
+ },
32
+ {
33
+ "type": "message",
34
+ "id": "a1b2c3d4",
35
+ "parentId": None,
36
+ "timestamp": "2026-01-01T00:00:01.000Z",
37
+ "message": {
38
+ "role": "user",
39
+ "content": text,
40
+ "timestamp": 1767225601000,
41
+ },
42
+ },
43
+ ]
44
+ with session_path.open('w', encoding='utf-8') as fh:
45
+ for entry in entries:
46
+ fh.write(json.dumps(entry, ensure_ascii=False) + "\n")
47
+ PY
48
+ }
49
+
8
50
  cleanup() {
9
51
  if [[ -n "$CURRENT_EVIDENCE_BACKUP" && -f "$CURRENT_EVIDENCE_BACKUP" ]]; then
10
52
  cp "$CURRENT_EVIDENCE_BACKUP" "$PKG_ROOT/.agent/verification-evidence.json"
@@ -96,12 +138,17 @@ bash .agent/verify_completion_control_plane.sh >/dev/null
96
138
 
97
139
  ROOT="$TMPDIR/repo"
98
140
  SYSTEM_REMINDER="$TMPDIR/system-reminder.txt"
141
+ BOOTSTRAP_SESSION="$TMPDIR/session-canonical-evidence-bootstrap.jsonl"
142
+ BOOTSTRAP_DISCUSSION=$'Mission: Exercise canonical evidence fixture bootstrap.\nScope:\n- Materialize canonical completion files for the evidence artifact fixture.\nConstraints:\n- Use supported bare /cook startup only.\nAcceptance:\n- Scaffold canonical files before the fixture rewrites them.'
99
143
  mkdir -p "$ROOT"
100
144
  cd "$ROOT"
101
145
  git init -q
146
+ write_session "$BOOTSTRAP_SESSION" "$ROOT" "$BOOTSTRAP_DISCUSSION"
102
147
 
148
+ PI_COMPLETION_CONTEXT_PROPOSAL_ACTION=accept \
149
+ PI_COMPLETION_DISABLE_CONTEXT_PROPOSAL_ANALYST=1 \
103
150
  PI_COMPLETION_SKIP_DRIVER_KICKOFF=1 \
104
- pi -e "$PKG_ROOT" -p "/cook canonical evidence fixture" \
151
+ pi --session "$BOOTSTRAP_SESSION" -e "$PKG_ROOT" -p "/cook" \
105
152
  >"$TMPDIR/pi-canonical-evidence-bootstrap.out" 2>"$TMPDIR/pi-canonical-evidence-bootstrap.err"
106
153
 
107
154
  for file in .agent/profile.json .agent/state.json .agent/plan.json .agent/active-slice.json .agent/verification-evidence.json; do