Merge pull request 'fix: fix: planner formula uses $FACTORY_ROOT for per-project artifacts — causes cross-repo contamination (#541)' (#542) from fix/issue-541 into main

This commit is contained in:
johba 2026-03-22 11:09:02 +01:00
commit e7094faede
2 changed files with 12 additions and 12 deletions

View file

@ -42,11 +42,11 @@ Set up the working environment for this planning run.
HEAD_SHA=$(git rev-parse HEAD)
echo "$HEAD_SHA" > /tmp/planner-head-sha
4. Read the planner memory file at: $FACTORY_ROOT/planner/MEMORY.md
4. Read the planner memory file at: $PROJECT_REPO_ROOT/planner/MEMORY.md
If it does not exist, this is the first planning run.
Keep this memory context in mind for all subsequent steps.
5. Read the prerequisite tree at: $FACTORY_ROOT/planner/prerequisite-tree.md
5. Read the prerequisite tree at: $PROJECT_REPO_ROOT/planner/prerequisite-tree.md
If it does not exist, create an initial tree from VISION.md in the
update-prerequisite-tree step.
"""
@ -234,11 +234,11 @@ Update the tree by applying these operations:
the vault see the file-at-constraints step for how to file requests.
6. **Check vault state**: Scan vault directories for procurement status:
- `$FACTORY_ROOT/vault/pending/*.md` requests awaiting human action.
- `$PROJECT_REPO_ROOT/vault/pending/*.md` requests awaiting human action.
Any prerequisite that depends on a pending procurement request should
be marked: `[ ] <name> blocked-on-vault (vault/pending/<id>.md)`
- `$FACTORY_ROOT/vault/approved/*.md` fulfilled, being processed.
- `$FACTORY_ROOT/vault/fired/*.md` completed. Check if the resource
- `$PROJECT_REPO_ROOT/vault/approved/*.md` fulfilled, being processed.
- `$PROJECT_REPO_ROOT/vault/fired/*.md` completed. Check if the resource
now appears in RESOURCES.md and mark the prerequisite resolved.
- Do NOT file issues for objectives blocked on pending vault items.
@ -246,7 +246,7 @@ Update the tree by applying these operations:
were not present last run. If a new resource appears, mark the
corresponding prerequisite as resolved.
Write the updated tree to: $FACTORY_ROOT/planner/prerequisite-tree.md
Write the updated tree to: $PROJECT_REPO_ROOT/planner/prerequisite-tree.md
Use this format:
# Prerequisite Tree
@ -343,7 +343,7 @@ an issue:
for this resource (match by filename).
2. If no request exists, create a markdown file at:
$FACTORY_ROOT/vault/pending/<resource-id>.md
$PROJECT_REPO_ROOT/vault/pending/<resource-id>.md
Format:
```
@ -389,7 +389,7 @@ memory is PERIODIC.
### 1. Prerequisite tree (always — committed to git)
Write the updated prerequisite tree to:
$FACTORY_ROOT/planner/prerequisite-tree.md
$PROJECT_REPO_ROOT/planner/prerequisite-tree.md
This is the tree you built in the update-prerequisite-tree step.
Include the "Last updated" comment at the top.
@ -397,7 +397,7 @@ Include the "Last updated" comment at the top.
### 2. Journal entry (always — committed to git)
Create a daily journal file at:
$FACTORY_ROOT/planner/journal/$(date -u +%Y-%m-%d).md
$PROJECT_REPO_ROOT/planner/journal/$(date -u +%Y-%m-%d).md
If the file already exists (multiple runs per day), append a new section
with a timestamp header.
@ -444,7 +444,7 @@ Decide whether to update memory:
does not exist, perform the memory update below.
4. Otherwise, skip the memory update MEMORY.md remains read-only context.
When updating memory, write to: $FACTORY_ROOT/planner/MEMORY.md
When updating memory, write to: $PROJECT_REPO_ROOT/planner/MEMORY.md
(replace the entire file)
Start the file with the run counter marker:

View file

@ -47,7 +47,7 @@ build_context_block VISION.md AGENTS.md RESOURCES.md planner/prerequisite-tree.m
# ── Read planner memory ─────────────────────────────────────────────────
MEMORY_BLOCK=""
MEMORY_FILE="$FACTORY_ROOT/planner/MEMORY.md"
MEMORY_FILE="$PROJECT_REPO_ROOT/planner/MEMORY.md"
if [ -f "$MEMORY_FILE" ]; then
MEMORY_BLOCK="
### planner/MEMORY.md (persistent memory from prior runs)
@ -57,7 +57,7 @@ fi
# ── Read recent journal files ──────────────────────────────────────────
JOURNAL_BLOCK=""
JOURNAL_DIR="$FACTORY_ROOT/planner/journal"
JOURNAL_DIR="$PROJECT_REPO_ROOT/planner/journal"
if [ -d "$JOURNAL_DIR" ]; then
# Load last 5 journal files (most recent first) for run history context
JOURNAL_FILES=$(find "$JOURNAL_DIR" -name '*.md' -type f | sort -r | head -5)