Darkwood · Symfony · Flow · context
Symfony + Flow experiment
The problem
Large context windows make it possible to send everything.
They do not make it wise.
Hypothesis
Tool
→ raw output
→ LLM
Tool
→ deterministic reducer
→ useful context
→ LLM
PHP handles
deduplication · classification · filtering · hashing · recovery
These tasks do not require a model.
content/nolife-tokens
Not used
No embeddings
No vector DB
No MCP
No Redis
No LangChain
Pipeline
Load → Classify
→ Measure → Optimize
→ Measure → Evaluate
Content is not all the same
Logs
[INFO] started
[INFO] started
[INFO] started
[ERROR] Payment failed
↓
[INFO] started ×3
[ERROR] Payment failed
JSON
id
status
error
telemetry…
↓
id
status
error
Git diff
- security check
+ …
Changed lines are
often already
the signal.
Natural compression limits differ by type.
TOKEN_PIPELINE_POC · measured
| Case | Raw* | Opt* | Saved | Signal |
|---|---|---|---|---|
| log | 4,839 | 1,190 | 75.4% | PASS |
| diff | 3,186 | 2,421 | 24.0% | PASS |
| JSON | 6,780 | 67 | 99.0% | PASS |
* estimated tokens = bytes / 4 — not provider-billed
Token reduction without signal retention is vanity.
The gap
raw
→ compress
→ information gone
raw
↘ stored omission
compress
↓
visible context
Next milestone: REVERSIBLE_CONTEXT_POC
Reversible references
Original
{
"id": 42,
"status": "failed",
"error": "…",
"telemetry": { "…6000 tok…" }
}
Optimized
{
"id": 42,
"status": "failed",
"error": "…",
"telemetry": "#ref:ctx_31154f"
}
Marker cost ≈ 4 estimated tokens
Flow pipeline
bin/console tokens:show-ref ctx_31154f
REVERSIBLE_CONTEXT_POC · measured
| Case | Raw* | Visible* | Referenced* | Saved | Refs |
|---|---|---|---|---|---|
| log coarse | 4,839 | 1,204 | 3,671 | 75.1% | 1 |
| log fine | 4,839 | 1,202 | 3,670 | 75.2% | 3 |
| JSON | 6,780 | 146 | 6,191 | 97.8% | 9 |
| diff | 3,186 | 2,434 | 749 | 23.6% | 1 |
* estimated (bytes / 4) · SIGNAL PASS · RECOVERY PASS on all rows
6,191 estimated JSON tokens moved out of active context.
Not destroyed. Recoverable.
Granularity experiment · logs
Coarse
1 ref
4 marker tokens
1,204 visible
Fine
3 refs
12 marker tokens
1,202 visible
3× more references for ~2 estimated tokens saved.
For this workload: coarse > fine
Workload-dependent — structured JSON can benefit from finer, positional refs.
For coding agents
Not another agent interface — better context for the ones we already use.
Next: progressive disclosure (L0 overview → expand #ref → raw).
What is the minimum context the model needs
to make the correct decision?