odd-studio 3.4.1 → 3.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/bin/odd-studio.js +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/hooks/odd-studio.sh +12 -26
- package/package.json +1 -1
- package/skill/SKILL.md +7 -14
package/bin/odd-studio.js
CHANGED
|
@@ -15,7 +15,7 @@ import { registerUninstall } from './commands/uninstall.js';
|
|
|
15
15
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
16
|
const __dirname = path.dirname(__filename);
|
|
17
17
|
const require = createRequire(import.meta.url);
|
|
18
|
-
const pkg = require('../package.json'); // v3.4.
|
|
18
|
+
const pkg = require('../package.json'); // v3.4.2
|
|
19
19
|
|
|
20
20
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
21
21
|
const deps = { PACKAGE_ROOT, print };
|
package/hooks/odd-studio.sh
CHANGED
|
@@ -61,9 +61,10 @@ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null |
|
|
|
61
61
|
CURRENT_PHASE=$(get_state_field "currentPhase")
|
|
62
62
|
|
|
63
63
|
# Helper: check marker file exists and is not stale
|
|
64
|
+
# Default TTL is 24 hours (86400s) — build sessions can last many hours
|
|
64
65
|
marker_valid() {
|
|
65
66
|
local marker="$1"
|
|
66
|
-
local max_age="${2:-
|
|
67
|
+
local max_age="${2:-86400}"
|
|
67
68
|
[ -f "$marker" ] || return 1
|
|
68
69
|
local age=$(( $(date +%s) - $(stat -f %m "$marker" 2>/dev/null || stat -c %Y "$marker" 2>/dev/null || echo 0) ))
|
|
69
70
|
[ "$age" -le "$max_age" ]
|
|
@@ -149,32 +150,20 @@ build-gate)
|
|
|
149
150
|
;;
|
|
150
151
|
|
|
151
152
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
152
|
-
# PreToolUse: Write|Edit — blocks source writes without
|
|
153
|
+
# PreToolUse: Write|Edit — blocks source writes without active build session
|
|
153
154
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
154
155
|
swarm-write)
|
|
155
156
|
[ "$TOOL_NAME" = "Write" ] || [ "$TOOL_NAME" = "Edit" ] || exit 0
|
|
156
157
|
[ "$CURRENT_PHASE" = "build" ] || exit 0
|
|
157
158
|
is_source_file "$FILE_PATH" || exit 0
|
|
158
159
|
|
|
159
|
-
# Gate
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
# Gate 2: Agent token must exist (short-lived, created by Task agents)
|
|
168
|
-
# Exception: allow the main conversation to write config/infrastructure files
|
|
169
|
-
# (package.json, .env, drizzle.config, tsconfig, etc.) during project setup
|
|
170
|
-
if ! marker_valid ".odd/.odd-flow-agent-token" 120; then
|
|
171
|
-
# Allow config and infrastructure files without agent token
|
|
172
|
-
if echo "$FILE_PATH" | grep -qE '(package\.json|\.env|tsconfig|next\.config|postcss\.config|tailwind\.config|drizzle\.config|vitest\.config|eslint\.config|\.gitignore|docker-compose|Dockerfile|vercel\.config|vercel\.ts)'; then
|
|
173
|
-
exit 0
|
|
174
|
-
fi
|
|
175
|
-
echo "ODD STUDIO [swarm-write]: Source writes blocked — no agent token." >&2
|
|
176
|
-
echo "Source code must be written by Task agents, not the main conversation." >&2
|
|
177
|
-
echo "Task agents run: touch .odd/.odd-flow-agent-token before writing." >&2
|
|
160
|
+
# Gate: Build session must be active (swarm marker with 24h TTL)
|
|
161
|
+
# Both the main orchestrator and Task agents can write source code
|
|
162
|
+
# when a build session is active. The swarm marker is refreshed when
|
|
163
|
+
# *build is invoked and during odd-flow coordination syncs.
|
|
164
|
+
if ! marker_valid ".odd/.odd-flow-swarm-active" 86400; then
|
|
165
|
+
echo "ODD STUDIO [swarm-write]: Source writes blocked — no active build session." >&2
|
|
166
|
+
echo "Run *build to start a build session before writing source code." >&2
|
|
178
167
|
echo "File blocked: $FILE_PATH" >&2
|
|
179
168
|
exit 2
|
|
180
169
|
fi
|
|
@@ -284,7 +273,7 @@ swarm-guard)
|
|
|
284
273
|
fi
|
|
285
274
|
|
|
286
275
|
# Gate 2: Swarm not initialised
|
|
287
|
-
if marker_valid ".odd/.odd-flow-swarm-active"
|
|
276
|
+
if marker_valid ".odd/.odd-flow-swarm-active" 86400; then
|
|
288
277
|
exit 0
|
|
289
278
|
fi
|
|
290
279
|
|
|
@@ -298,10 +287,7 @@ swarm-guard)
|
|
|
298
287
|
echo "ODD STUDIO — SWARM NOT INITIALISED${STALE}"
|
|
299
288
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
300
289
|
echo ""
|
|
301
|
-
echo " You are in build phase.
|
|
302
|
-
echo " before ANY other action."
|
|
303
|
-
echo ""
|
|
304
|
-
echo " Run the 9-step swarm init sequence now (see *build protocol step 7)."
|
|
290
|
+
echo " You are in build phase. Initialise the swarm with *build or *swarm."
|
|
305
291
|
echo ""
|
|
306
292
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
307
293
|
echo ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "odd-studio",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Outcome-Driven Development for AI coding agents — a planning and build harness for domain experts building serious software with AI. Works with Claude Code, OpenCode, and Codex.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
package/skill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "odd"
|
|
3
|
-
version: "3.4.
|
|
3
|
+
version: "3.4.2"
|
|
4
4
|
description: "Outcome-Driven Development planning and build coach. Use /odd to start or resume an ODD project — building personas, writing outcomes, mapping contracts, creating a Master Implementation Plan, and directing a odd-flow-powered build. Designed for domain experts who are not developers. Works with Claude Code, OpenCode, and Codex."
|
|
5
5
|
metadata:
|
|
6
6
|
priority: 10
|
|
@@ -96,7 +96,7 @@ Display this when no existing state is found:
|
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
-
Welcome to ODD Studio v3.4.
|
|
99
|
+
Welcome to ODD Studio v3.4.2.
|
|
100
100
|
|
|
101
101
|
You are about to plan and build something real — using a methodology called Outcome-Driven Development. Before we write a single line of code, we are going to get precise about three things:
|
|
102
102
|
|
|
@@ -120,7 +120,7 @@ Display this when existing state is found. Replace the bracketed values with act
|
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
|
-
Welcome back to ODD Studio v3.4.
|
|
123
|
+
Welcome back to ODD Studio v3.4.2.
|
|
124
124
|
|
|
125
125
|
**Project:** [project.name]
|
|
126
126
|
**Current Phase:** [state.currentPhase]
|
|
@@ -631,20 +631,13 @@ Create the swarm marker file that unlocks source code writes:
|
|
|
631
631
|
touch .odd/.odd-flow-swarm-active
|
|
632
632
|
```
|
|
633
633
|
|
|
634
|
-
**Why this matters:** The `odd-
|
|
634
|
+
**Why this matters:** The `odd-studio.sh` hook enforces a single-marker system during the build phase. The swarm-active marker must exist for source code writes to succeed:
|
|
635
635
|
|
|
636
|
-
1. **`.odd/.odd-flow-swarm-active`** —
|
|
637
|
-
2. **`.odd/.odd-flow-agent-token`** — short-lived token created by Task agents before writing code (120-second TTL).
|
|
636
|
+
1. **`.odd/.odd-flow-swarm-active`** — build session is active (24-hour TTL). Created here at step 8.
|
|
638
637
|
|
|
639
|
-
|
|
638
|
+
Both the main orchestrator AND Task agents can write source code when the swarm-active marker is valid. This removes the friction of the previous two-marker system while still ensuring the build session is properly initialised before any code is written.
|
|
640
639
|
|
|
641
|
-
|
|
642
|
-
touch .odd/.odd-flow-agent-token
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
**Every Task agent spawned for build work MUST include this instruction:** "Before writing any source code, run: `touch .odd/.odd-flow-agent-token` — this creates the short-lived agent write token required by the ODD swarm write gate. Refresh it before each batch of file writes."
|
|
646
|
-
|
|
647
|
-
This prevents the most common protocol drift: the LLM bypassing swarm coordination by editing files directly from the main conversation.
|
|
640
|
+
The marker TTL is 24 hours (86400 seconds) because build sessions can last many hours. If the marker expires, run `*build` again to refresh it.
|
|
648
641
|
|
|
649
642
|
### 9. Sync All Agents
|
|
650
643
|
|