Skip to content

fix: harden WORKFLOW.md with symphony patterns and mempalace#259

Merged
kaiweijw merged 11 commits intomainfrom
fix/workflow-hardening
Apr 10, 2026
Merged

fix: harden WORKFLOW.md with symphony patterns and mempalace#259
kaiweijw merged 11 commits intomainfrom
fix/workflow-hardening

Conversation

@kaiweijw
Copy link
Copy Markdown
Collaborator

Summary

  • Adopt battle-hardened prompt contracts from chronoai-symphony: Mission with explicit stop conditions, Non-Negotiable Rules, Status Map, State Routing, Execution/Review/Rework Contracts, Blockers and Handoff, coordination surface docs
  • Add mandatory mempalace integration with python3 -m mempalace (bypasses PATH issue with pip install), wake-up context (L0+L1), and explicit agent instructions for search/store
  • Add {{ default_prompt }} to triage and reviewer stage prompts so they inherit the base prompt, with CRITICAL role boundaries to prevent non-implementer agents from writing code
  • Fix Codex compatibility: thread_sandbox: danger-full-access for git access, remove turn_sandbox_policy string (Codex v0.118.0 rejects it, Symphony now translates internally)
  • Fix parallel stage validation: fullstack implementer uses when_labels: [fullstack] with non-root scope
  • Add state_instructions and role_instructions for code-review/rework overlays
  • Fix agent timeouts: read_timeout_ms: 60000, explicit stall_timeout_ms on claude profile
  • Add missing terminal states (Canceled, Duplicate)
  • Hook improvements: subshells for cd, non-fatal build in after_create, timeout 300s -> 600s

Test plan

  • Symphony validates WORKFLOW.md without errors
  • after_create hook succeeds (build failure no longer blocks workspace creation)
  • Triage agent labels and transitions without implementing code
  • Codex handshake succeeds with thread_sandbox: danger-full-access (requires Symphony rebuild with sandbox enum fix)
  • Codex can git commit/push with restored sandbox access
  • Mempalace context files generated in .symphony/ during before_run
  • Agents read mempalace context and use MCP tools for search/store

kaiweijw added 11 commits April 10, 2026 18:14
- Use python3 -m mempalace instead of bare mempalace binary (pip install
  puts the binary outside PATH on most systems)
- Make mempalace mandatory in hooks: after_create mines project, before_run
  loads context, after_run stores coordination artifacts
- Add {{ default_prompt }} to triage and reviewer stage prompts so they
  inherit the base prompt (Non-Negotiable Rules, Architecture Rules,
  Workpad, Git rules, Coordination surface, Final Checklist)
- Add state_instructions and role_instructions for code-review/rework
- Add missing terminal states (Canceled, Duplicate)
- Fix codex read_timeout_ms 5000 -> 30000 to prevent handshake timeouts
- Add turn_sandbox_policy to codex agent config
- Add --depth 1 to git clone for faster workspace creation
- Adopt hardened prompt contracts from chronoai-symphony: Mission with
  explicit stop conditions, Non-Negotiable Rules, Status Map, State
  Routing, Execution/Review/Rework Contracts, Blockers and Handoff
The validator requires every runnable stage sharing a state to define a
scope. The implementer fallback shares 'in-progress' with
backend-implementer and frontend-implementer, so it needs scope: ./
The validator rejects root scope (./) for parallel pipeline stages.
The fullstack implementer now requires a `fullstack` label from triage
(mutually exclusive with backend/frontend labels) and uses a non-root
scope. Triage prompt updated to always assign one routing label.
The after_create hook fails on cold Rust builds that exceed the 300s
timeout. Increase to 600s. Also wrap cd commands in subshells so the
working directory stays at repo root for mempalace commands.
The cargo build in after_create is only a cache-warm — the real build
runs in before_run after branch checkout. A compile failure in
after_create should not prevent workspace creation since the agent
needs the workspace to exist before it can do anything.
The triage agent was implementing fixes instead of just labeling and
handing off. The base prompt's Execution Contract tells agents to
"make changes that resolve your role's responsibility" which the
triage agent interpreted as writing code. Added explicit boundaries
before {{ default_prompt }} to override that behavior.
Same issue as triage — the base prompt's Execution Contract tells
agents to make changes, which the reviewer could interpret as writing
fixes. Added boundaries: review only, no code, no commits.
Codex app-server handshake consistently times out at 30s. Increase to
60s for both agents. Also add explicit read_timeout_ms and
stall_timeout_ms to the claude profile (was relying on defaults).

Note: the immediate Codex failure is likely due to missing
OPENAI_API_KEY — the process launches but produces zero output.
Codex v0.118.0 changed sandboxPolicy from a plain string to an
internally tagged enum. Sending "danger-full-access" as a string
now fails with: invalid type: string, expected internally tagged
enum SandboxPolicy. Remove both thread_sandbox and
turn_sandbox_policy so Symphony uses its structured defaults
(workspaceWrite with full network access).
Agents need explicit instructions to use mempalace — having the MCP
server connected is not enough. Added:

- before_run: generate wake-up context (L0+L1) via `mempalace wake-up`
- Prompt template: MemPalace section with instructions for session
  start (read wakeup + context files), during work (search before
  deciding), and session end (store decisions and patterns)
- Agents now know to use mempalace_search, mempalace_kg_query,
  mempalace_diary_write, mempalace_add_drawer, and mempalace_kg_add
Without thread_sandbox: danger-full-access, Codex cannot write to
.git/ (index.lock permission denied). Symphony now translates this
to the tagged enum format Codex v0.118.0 expects.
@kaiweijw kaiweijw merged commit 8875539 into main Apr 10, 2026
8 checks passed
@kaiweijw kaiweijw deleted the fix/workflow-hardening branch April 10, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant