Enforce Teams mode as default parallel execution#2
Merged
Conversation
…g table - Add Phase 0: verify OWNED_FILES, TASK_ID, and log ownership set - Add TEAM_MODE Pre-Edit Gate in Phase 2 with explicit stop-and-check - Strengthen pre-return checklist with Teams-specific items - Add Red Flag Thoughts table to catch common bypass patterns Task: fn-5-enforce-teams-mode-as-default-parallel.3
When FLOW_TEAMS=1, the PreToolUse hook now checks the flowctl file-lock registry before allowing Edit/Write operations. Edits to files locked by another task are blocked; edits to own-task files are allowed. Fails-open on errors for graceful degradation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
z23cc
added a commit
that referenced
this pull request
Apr 5, 2026
Adds a lightweight per-task narrative dump at `.flow/outputs/<task-id>.md` that workers write in new Phase 5c and the next worker auto-reads during Phase 1 re-anchor. Gated on a new `outputs.enabled` config key (default true), fully independent from `memory.enabled` — outputs is a narrative handoff layer, not part of the verified memory system. - flowctl-core: new `OutputEntry` protocol type (convention #8) - flowctl-service: new `OutputsStore` (file-system native, no libSQL) - flowctl-cli: new `flowctl outputs write|list|show` commands - Phase 5c `outputs_dump` added to worker sequence dynamically based on `outputs.enabled` config; worker.md Phase 1 extended to list+show prior outputs (limit 3) and Phase 5c added between Phase 5 and Phase 5b - `done_task()` in lifecycle.rs intentionally unchanged — worker owns the dump explicitly in Phase 5c, keeping runtime agnostic of narrative shape - Missing `## Surprises`/`## Decisions` sections allowed (pitfall #2)
z23cc
added a commit
that referenced
this pull request
Apr 9, 2026
P0 fixes (state loss — root cause of 5 issues): - get_flow_dir() now walks up directory tree (FLOW_STATE_DIR env → walk-up → CWD) Fixes: #1 state loss, #3 state not persistent, #5 worker parallel fail, #9 .flow symlink issues. Same pattern as git finding .git. - flowctl recover --epic <id> [--dry-run]: rebuilds task completion status from git log. Fixes #11 no recovery after state loss. P1 fixes (guard + review): - Guard graceful fallback: missing tools → "skipped" (not "failed"). Only actual failures block pipeline. Fixes #8. - Review-backend availability check: if rp-cli/codex not in PATH, auto-fallback to "none" with warning. Fixes #7. P2 fixes (UX): - Slug max length 40→20 chars. "Django+React platform with account management" → "fn-3-django-react-plat" not 40-char monster. Fixes #2 #12. - Brainstorm auto-skip: trivial tasks (≤10 words, contains "fix"/"typo"/etc) skip brainstorm entirely. Fixes #6. - --interactive flag: pause at key decisions. Fixes #10. 370 tests pass. Zero new dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the gap where
/flow-code:workcould skip Teams mode when spawning parallel workers. Three enforcement layers added:Layer 1 — Prompt hardening (phases.md, SKILL.md)
Layer 2 — Runtime enforcement (ralph-guard.py)
FLOW_TEAMS=1Layer 3 — Worker self-verification (worker.md)
Test plan
python3 -m py_compile scripts/hooks/ralph-guard.pypasseshooks/hooks.jsonvalid JSONteams_e2e_test.sh— 32/32 passed🤖 Generated with Claude Code