summaryrefslogtreecommitdiffhomepage
path: root/notes
diff options
context:
space:
mode:
Diffstat (limited to 'notes')
-rw-r--r--notes/assumptions-log.md23
1 files changed, 22 insertions, 1 deletions
diff --git a/notes/assumptions-log.md b/notes/assumptions-log.md
index a04467b..57873e0 100644
--- a/notes/assumptions-log.md
+++ b/notes/assumptions-log.md
@@ -14,7 +14,28 @@
## Task 2 — System context builder not loading referenced files
-*Assumptions will be appended here as the work progresses.*
+1. **My reproduction shows the resolver is not buggy.** A standalone script using
+ the exact same `resolvePath(cwd, "AGENTS.md")` + `Bun.file(...).exists()/.text()`
+ logic successfully reads `/home/tradam/projects/dispatch/arch-rewrite/AGENTS.md`
+ when `cwd` is that directory. So the file-reading path in system-prompt works.
+2. **The failure mode is stale cached system prompt after a cwd change.** The system-
+ prompt service constructs once on the first turn of a new conversation and
+ reuses the result via `get()` on subsequent turns (cache-safe design). If the
+ conversation's cwd is changed after the first turn (or if the conversation was
+ created before system-prompt existed), the stored prompt was built against a
+ different cwd and does not include `AGENTS.md` from the new directory. I am
+ adding reconstruction when the stored prompt's cwd differs from the current
+ effective cwd.
+3. **Reconstructing on cwd change is the correct cache-vs-freshness trade.** The
+ system prompt is intentionally cwd-sensitive (`[prompt:cwd]` and `file:` vars);
+ when the cwd changes the prompt MUST change, so the cache was already stale
+ from a semantic standpoint. We still preserve construction-once-per-cwd.
+4. **Storage shape chosen:** keep `resolved:<conversationId>` as the resolved
+ prompt string (no migration needed for existing rows), and add a sibling key
+ `resolved-cwd:<conversationId>` for the cwd it was built against. A new
+ `SystemPromptService.getWithMeta(conversationId)` returns `{ prompt, cwd }`
+ so the orchestrator can compare before deciding to reconstruct.
+
## Task 3 — Persistent provider + model selection per chat