# Phase 3 — context extraction ## Goal Build deterministic machine-readable evidence packets for naming, diff summaries, and later transform replay decisions without using an LLM. ## Script `scripts/extract-context.js` ## Deliverables - `runs//context/segments.jsonl` - `runs//context/bindings.jsonl` - `runs//reports/context-summary.md` - detailed requirements: [docs/phase-3-requirements.md](file:///home/user/git/amp-decompiled/docs/phase-3-requirements.md) ## Packet contents per segment - stable segment ID - canonical code reference - local binding graph - visible import-like origins - member access patterns - string literals, export hints, error text, CLI flags, and neighboring context - callsite, assignment, and return usage hints for local functions ## Release-oriented requirements - context must be deterministic across reruns of the same snapshot - context should support compact upstream summaries, not just naming prompts - context packets must remain usable when deriving transform anchors for maintained changes ## Verification - spot-check bindings and call patterns for representative segments - confirm packets are deterministic across two runs of the same bundle