enhance: [ENG-2128] inline file contents in operation prompts#432
enhance: [ENG-2128] inline file contents in operation prompts#432danhdoan merged 2 commits intoproj/dreamingfrom
Conversation
|
Claude finished @danhdoan's task in 2m 52s —— View job PR Review: enhance/ENG-2128 — Inline file contents in operation promptsTasks
SummaryScore: 4 / 5 Correct diagnosis, clean fix, strong evidence. The root cause ( What's good
Issues found (inline comments posted)
Security notes
Minor observations
|
b98eba3 to
e25e43e
Compare
|
Claude finished @danhdoan's task in 2m 48s —— View job PR Review: enhance/ENG-2128 — Inline file contents in operation promptsTasks
SummaryScore: 4 / 5 Correct diagnosis, clean fix, strong evidence. The root cause ( What's good
Issues found (inline comments posted)
Security notes
Minor observations
|
|
Claude finished @danhdoan's task in 3m 1s —— View job PR Review: enhance/ENG-2128 — Inline file contents in operation promptsTasks
SummaryScore: 4 / 5 Correct diagnosis, clean fix, strong evidence. The root cause ( What's good
Issues found (inline comments posted)
Security notes
Minor observations
|
Consolidate and synthesize injected file content via
setSandboxVariableOnSession and told the LLM to call code_exec to read
it.
The LLM often skipped code_exec, saw only paths without content, and
returned {"actions": []} — producing zero operations on clear-cut cases.
The outer catch {} swallowed the silence, so dream logs reported
status: completed with no errors.
Inline file contents directly in the prompt as marked blocks. Remove the
sandbox-variable indirection. Tighten rule wording to nudge the LLM away
from the SKIP-everything default. Prune already inlined content; also
bump its preview size and rewrite conservative wording.
Unit tests updated to assert on prompt content instead of
sandbox-variable
calls. Auto-test suite (local-auto-test/dreaming) now passes 24/24 with
a
working LLM provider: force-merge, force-synthesize, and force-archive
scenarios all produce their expected operations end-to-end.
cdfcb21 to
b40ad73
Compare
PR Review: enhance/ENG-2128 — Inline file contents in operation promptsTasks
|
|
Claude finished @danhdoan's task in 1m 50s —— View job PR Review: enhance/ENG-2128 — Inline file contents in operation promptsTasks
SummaryScore: 4.5 / 5 Previous review feedback has been addressed cleanly. The three issues flagged as suggestions/nits in the prior reviews are all resolved in this sync. Two minor gaps remain open. Previous review items — status
Remaining gaps1. The PR description explicitly acknowledges the missing size cap as a follow-up. Without a // TODO: add a size cap for domain summaries (similar to consolidate's capPayloadSize)
// to guard against vaults with many verbose _index.md files hitting model context limits.
const prompt = buildPrompt(domains, existingSyntheses)2. Tests — missing negative assertion for All three test fixtures stub expect(agent.setSandboxVariableOnSession.called).to.be.false
What's good
Security notesNo new concerns since the prior review. Inline file content is a standard RAG pattern, user-owned data, and all LLM output is schema-validated before any filesystem action. |

Summary
brv dreamsee "completed" with zero operations and no errors — no way to know the feature isn't working.Update unit tests to assert on prompt content.
catch {}blocks remain as a separate follow-up.Type of change
Scope (select all touched areas)
Linked issues
proj/dreaming)Root cause (bug fixes only)
agent.setSandboxVariableOnSession(sessionId, '__dream_*_files', payload)and instructed the LLM to invokecode_execto read the variable before classifying. The LLM frequently skippedcode_exec, evaluated paths without content, and returned an empty actions array. Prune already inlined content so it was unaffected.local-auto-test/dreaming/to close this gap with real LLM calls against designed-to-force-operations fixtures.Test plan
test/unit/infra/dream/operations/consolidate.test.tstest/unit/infra/dream/operations/synthesize.test.tstest/unit/infra/dream/operations/prune.test.ts_index.mdforce-merge: near-duplicate files → MERGE operationforce-synthesize: 3 domains sharing FlushCoordinator → SYNTHESIZEforce-archive: stale low-importance draft → ARCHIVE (unchanged)User-visible changes
None for users of
brv dream. The feature now produces operations it previously didn't produce, but the CLI surface, flags, and output format are unchanged. Dream log schema unchanged.Evidence
Auto-test results before vs after the fix:
Before (unstashed code): 19/21 passed
After (this PR): 24/24 passed
type: synthesisfrontmatter)Unit tests: 6169 passing, 0 failing. Build clean. Lint clean (warnings pre-existing).
Checklist
npm test)npm run lint)npm run buildwithtsc -b)npm run build)proj/dreamingRisks and mitigations
capPayloadSize()enforcesMAX_PAYLOAD_CHARS = 200_000with changed-files-first eviction._index.mdcontent. Summaries are typically small, but a vault with many verbose domain summaries could hit model limits. Tracked as a follow-up task to add a cap similar to consolidate's.needsReview: true. Operations flagged for review are queued inbrv review pendingbefore affecting the context tree permanently.brv dream --undocan also revert the last dream wholesale.summary.errorsshould reflect caught failures in the dream log so users can see when LLM calls fail.