@zachjxyz/moxie 0.6.2 → 0.6.4

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/moxie CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  set -euo pipefail
19
19
 
20
- MOXIE_VERSION="0.6.2"
20
+ MOXIE_VERSION="0.6.4"
21
21
  # Resolve symlinks (npm installs bin as a symlink)
22
22
  _self="$0"
23
23
  while [ -L "$_self" ]; do
package/lib/phases.sh CHANGED
@@ -1108,8 +1108,51 @@ _force_accept_best_draft() {
1108
1108
  done
1109
1109
 
1110
1110
  if [ -z "$best" ]; then
1111
- echo " No draft files found to accept." >&2
1112
- return 1
1111
+ # No draft .md files create a synthetic FINAL from the ledger
1112
+ # (common for fix/build phases where agents modify code directly)
1113
+ echo " No draft files found — creating FINAL from ledger state."
1114
+ local ts
1115
+ ts=$(date +"%m%d%y-%H%M%S")
1116
+ local final_file="$phase_dir/${final_prefix}-${ts}.md"
1117
+ python3 -c "
1118
+ import json
1119
+ with open('$ledger') as f:
1120
+ d = json.load(f)
1121
+ lines = ['# $(phase_prefix "${final_prefix%-FINAL}") Phase — Complete', '']
1122
+ lines.append('Phase completed via force-accept (all agents verified).')
1123
+ lines.append('')
1124
+ for name, info in d.get('agents', {}).items():
1125
+ status = 'reached' if info.get('reached') else 'pending'
1126
+ note = info.get('notes', '')
1127
+ lines.append(f'- **{name}**: {status}')
1128
+ if note:
1129
+ lines.append(f' {note}')
1130
+ for item in d.get('findings', d.get('issues', [])):
1131
+ if isinstance(item, str):
1132
+ lines.append(f'- {item}')
1133
+ elif isinstance(item, dict):
1134
+ lines.append(f'- {item}')
1135
+ print('\n'.join(lines))
1136
+ " > "$final_file" 2>/dev/null
1137
+
1138
+ # Mark all agents as reached in the ledger
1139
+ python3 -c "
1140
+ import json, os
1141
+ with open('$ledger') as f:
1142
+ d = json.load(f)
1143
+ for name in d.get('agents', {}):
1144
+ d['agents'][name]['reached'] = True
1145
+ d['status'] = '$(echo "$final_prefix" | tr '[:upper:]' '[:lower:]' | tr '-' '_')'
1146
+ tmp = '$ledger' + '.tmp'
1147
+ with open(tmp, 'w') as f:
1148
+ json.dump(d, f, indent=2)
1149
+ os.rename(tmp, '$ledger')
1150
+ " 2>/dev/null
1151
+
1152
+ echo " Accepted: $(basename "$final_file")"
1153
+ echo ""
1154
+ _show_quorum "$ledger"
1155
+ return 0
1113
1156
  fi
1114
1157
 
1115
1158
  local ts
@@ -1324,8 +1367,18 @@ with open('$prompt_file', 'w') as f:
1324
1367
  show_phase_tokens "$csv"
1325
1368
  return 0
1326
1369
  else
1327
- echo " All healthy agents reached quorum but FINAL file not yet written."
1328
- echo " Next agent will write it."
1370
+ echo " All healthy agents reached quorum writing FINAL."
1371
+ _force_accept_best_draft "$phase_dir" "$final_prefix" "$ledger"
1372
+ local healthy
1373
+ healthy=$(count_healthy_agents)
1374
+ echo ""
1375
+ echo "╔════════════════════════════════════════════════════════════╗"
1376
+ printf "║ %-58s║\n" "$(phase_label "$phase") phase complete — quorum reached"
1377
+ printf "║ %d/%d agents signed off ║\n" "$healthy" "$AGENT_COUNT"
1378
+ echo "╚════════════════════════════════════════════════════════════╝"
1379
+ echo ""
1380
+ show_phase_tokens "$csv"
1381
+ return 0
1329
1382
  fi
1330
1383
  fi
1331
1384
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zachjxyz/moxie",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Run multiple AI coding agents through spec-driven phases with quorum convergence. Supports CLI agents (Claude, Codex, Qwen, Aider, Goose, Amp, Cline, Roo) and Vercel AI Gateway models.",
5
5
  "bin": {
6
6
  "moxie": "bin/moxie"
@@ -35,22 +35,19 @@ Thoroughly explore the project directory. Read:
35
35
 
36
36
  ### Step 3: Generate or review the RFC
37
37
 
38
- **If no draft exists:** Write a comprehensive RFC covering:
39
-
40
- 1. **Title and Summary** — What the project is, in one paragraph
41
- 2. **Motivation** — Why this project exists, what problem it solves
42
- 3. **Architecture Overview** — High-level system diagram (text), key modules and their responsibilities
43
- 4. **Data Model** — All entities, their fields, relationships, constraints
44
- 5. **API Surface** — Every endpoint/tool/command with request/response schemas
45
- 6. **Authentication & Authorization** — Auth model, roles, permissions
46
- 7. **Core Algorithms** — Search, ranking, lifecycle, processing pipelines
47
- 8. **Configuration** — All config options, environment variables, defaults
48
- 9. **Error Handling** — Error taxonomy, status codes, retry strategies
49
- 10. **Observability** — Logging, metrics, tracing, health checks
50
- 11. **Build & Deployment** How to build, test, deploy
51
- 12. **Security Considerations** — Threat model, mitigations
52
- 13. **Open Questions** — Unresolved design decisions (if any)
53
-
38
+ **If no draft exists:** Write a comprehensive RFC. Include ONLY sections relevant to this
39
+ project — do not invent sections for features that don't exist. Common sections:
40
+
41
+ - **Title and Summary** — What the project is, in one paragraph
42
+ - **Architecture Overview** — Key modules, their responsibilities, how they connect
43
+ - **Data Model** — Entities, fields, relationships (if applicable)
44
+ - **API Surface** — Endpoints, commands, or interfaces (if applicable)
45
+ - **Core Logic** — Main algorithms, processing pipelines, business rules
46
+ - **Configuration** — Config options, environment variables, defaults
47
+ - **Build & Deployment** — How to build, test, deploy
48
+ - **Open Questions** — Unresolved design decisions (if any)
49
+
50
+ Skip sections that don't apply. Do NOT pad the RFC with placeholder content.
54
51
  For EACH section, cite specific files and line numbers from the actual source code.
55
52
 
56
53
  **If a draft exists:** Review it section by section against the actual source code.
@@ -88,6 +85,7 @@ If ALL agents (every agent in the config) show `reached: true`:
88
85
 
89
86
  - Be EXHAUSTIVE — this RFC drives the entire pipeline. Missing details here mean gaps downstream.
90
87
  - ALWAYS verify against actual source code. Cite file paths and line numbers for every claim.
88
+ - Be efficient with tool use: use offset/limit when reading files — only read the sections you need, not entire files.
91
89
  - NEVER rubber-stamp a draft. Read the source code yourself and independently verify.
92
90
  - The RFC must be self-contained: an agent reading only this document should understand the full system.
93
91
  - Do NOT shortcut this phase for speed. Thoroughness is the goal. Quorum means genuine agreement.
@@ -63,7 +63,10 @@ Update `.moxie/phases/02-audit/ledger.json`:
63
63
  - Add/update your agent in the `agents` map with `output_file` pointing to your file
64
64
  - If you confirmed ALL findings from ALL prior agents with ZERO new findings and ZERO corrections:
65
65
  set your entry to `reached: true`
66
- - If you have ANY new findings or corrections: reset ALL agents to `reached: false`
66
+ - If you have new findings rated **medium or higher**, or corrections to existing findings:
67
+ reset ALL agents to `reached: false` (forces re-verification)
68
+ - Trivial findings (low severity, documentation-only, cosmetic) should be noted but do NOT
69
+ require resetting quorum — add them to findings and keep existing reached states
67
70
 
68
71
  ### Step 6: Quorum check
69
72
 
@@ -84,6 +87,7 @@ Do NOT write the FINAL file unless ALL agents show `reached: true` in the ledger
84
87
 
85
88
  - ALWAYS verify against actual source code, not other audits
86
89
  - ALWAYS cite file paths and line numbers
90
+ - Be efficient with tool use: use offset/limit when reading files — only read the sections you need, not entire files.
87
91
  - NEVER rubber-stamp — check the source yourself even if you agree
88
92
  - Do NOT shortcut this phase for speed. Thoroughness prevents bugs downstream.
89
93
  - If you are unsure about a finding, investigate deeper rather than confirming blindly
@@ -59,7 +59,10 @@ Do NOT write the FINAL file unless ALL agents show `reached: true` in the ledger
59
59
 
60
60
  ## Rules
61
61
 
62
+ - ONLY fix issues listed in the AUDIT-FINAL document. Do not refactor, clean up, or "improve"
63
+ code beyond what the audit identified. Scope creep here delays the pipeline.
62
64
  - Fix highest severity issues first
65
+ - Be efficient with tool use: use offset/limit when reading files — only read the sections you need.
63
66
  - ALWAYS run the full test suite after changes
64
67
  - NEVER introduce new warnings or break existing tests
65
68
  - When verifying, actually READ the code — not just test output
@@ -8,8 +8,10 @@ CONTEXT DOCS: .moxie/context/ (if present)
8
8
 
9
9
  ## Context
10
10
 
11
- Audit issues are fixed. Now we need a finalized implementation plan that covers
12
- everything in the spec, incorporates fixes, and can be executed by agents in the build phase.
11
+ Audit issues are fixed. Now we need a finalized implementation plan for what the spec
12
+ describes but the codebase doesn't yet have. Compare the spec against the current source
13
+ the plan should cover the DELTA: features, changes, or improvements the spec calls for
14
+ that are not yet implemented. Do not plan work that's already done.
13
15
 
14
16
  **IMPORTANT: This pipeline requires UNANIMOUS quorum. ALL agents must independently verify
15
17
  the plan against the spec and source code. Do NOT rubber-stamp — thoroughness is the goal.**
@@ -64,6 +66,7 @@ Do NOT write the FINAL file unless ALL agents show `reached: true` in the ledger
64
66
  ## Rules
65
67
 
66
68
  - All file paths must be accurate against current source
69
+ - Be efficient with tool use: use offset/limit when reading files — only read the sections you need.
67
70
  - Plan must be self-contained — agents must be able to build from it alone
68
71
  - Phase ordering must respect dependencies
69
72
  - Cite specific file paths and line numbers for every existing code reference
@@ -71,6 +71,7 @@ Do NOT write the FINAL file unless ALL agents show `reached: true` in the ledger
71
71
  ## Rules
72
72
 
73
73
  - Complete phases in order — never skip
74
+ - Be efficient with tool use: use offset/limit when reading files — only read the sections you need.
74
75
  - Each phase must pass the full test suite before marking "built"
75
76
  - Verifiers must READ the code — no rubber-stamping based on test output alone
76
77
  - Zero regressions on existing tests