Phase 3C context-render only
- Render an existing
context.jsonoperational context file into a deterministic, token-light plain-text layout. - Save the rendered text to
artifacts/spark/context_render.txt. - Prevent any leak of raw payload values (no
applicantraw values,decision_recommendationraw values,notes, or raw payload contents).
Allowed in Phase 3C:
- Add context rendering logic.
- Add exactly one CLI command:
context-render. - Add unit/integration tests for the rendering routine.
- Generate
artifacts/spark/context_render.txtonly.
Forbidden in Phase 3C:
- No
context-validatecommand. - No MCP server implementation or integration.
- No database connections, active tool executors, or LLM clients.
- No schema or package code modifications.
- No reconstruction of raw payload or tracing history.
- No source code changes beyond registering
context-render.
The subsequent implementation prompt may modify/create only the following files:
agy7rust/src/main.rsagy7rust/src/lib.rsagy7rust/src/commands/mod.rsagy7rust/src/commands/context_render.rsagy7rust/src/context/mod.rsagy7rust/src/context/render.rsagy7rust/tests/spark_roundtrip.rsartifacts/spark/context_render.txtagy7rust/PHASE3C_STATUS.md
Do not read, write, or modify:
agy7rust/src/commands/context_validate.rsagy7rust/src/context/validate.rsschemas/examples/README.md- Prior phase snapshots (
PHASE1_SPARK_SNAPSHOT.md,PHASE2_SCHEMA_SIDECAR_SNAPSHOT.md,PHASE3A_CONTEXT_MODEL_SNAPSHOT.md,PHASE3B_CONTEXT_BUILD_SNAPSHOT.md) - Local agent skills (
.agent/skills/*)
Command:
agy7rust context-render -i <context.json> -o <context_render.txt>Success Output:
OK: context-render passed
context: <context_id>
rendered_bytes: <rendered size>
Failure Output:
ERROR: context-render failed
reason: <stable reason>
- Template Layout: The output layout must use a stable text-only structure (e.g. key-value lines and bulleted items).
- Element Sorting: All lists (required field paths, satisfied paths, missing paths, constraints, non-claims, validation issues) must be rendered in alphabetical order.
- Graph Edges: Dependency edges, blockers, and recovery paths must be printed lexicographically by
source -> target. - Newline and Padding: Consistent indentation and a trailing newline must be enforced.
- Repeatability: Multiple rendering runs against identical
context.jsoninputs must yield byte-identicalcontext_render.txtfiles.
The generated context_render.txt must NOT contain:
applicantraw values (e.g."Nordwind Energie GmbH").decision_recommendationraw values (e.g."Zustimmung...").extraction.notes(notes) raw contents.source_pdf_contentsor raw payload bytes.- Full original extraction JSON structure.
The integration test suite must assert:
context-rendersuccessfully processes the builtcontext.json.- Output layout matches the deterministic formatting rules.
- Output file contains a trailing newline.
- Repeated rendering yields identical output hashes.
- Leak assertions pass (no raw payload values are printed in
context_render.txt). - No
context-validateCLI command is registered.
Before completion, the following command pipeline must execute cleanly:
cd C:\Users\contr\sandbox_workspace\Antigravity-Comptextv7-unified\agy7rust
cargo fmt
cargo fmt --all --check
cargo check
cargo test
cargo clippy -- -D warnings
cargo run -- context-render -i ..\artifacts\spark\context.json -o ..\artifacts\spark\context_render.txt
cargo run -- schema-check -i ..\examples\spark\extraction.json -s ..\schemas\genehmigung_v1.json
powershell -File .\demo_spark.ps1Stop execution and report blocked if:
- Rendering code requires recreating or holding raw payload fields.
- Layout rendering relies on local system time, environment, or system-specific file separator constants.
- The requirements ask to integrate active LLM tokenization or text compression libraries.
- The prompt asks to register a
context-validatecommand. - Modifying command routing requires changes outside the CLI registration boundaries.
Report execution status using this exact block structure:
PHASE: Phase 3C implementation - context-render only
STATUS: success | blocked
SKILLS_USED:
- ...
FILES_CHANGED:
- ...
COMMANDS_RUN:
- ...
TESTS:
- ...
CONTEXT_RENDER:
- ...
DETERMINISM_CHECK:
- ...
LEAK_CHECK:
- ...
DEMO:
- ...
RISKS:
- ...
NEXT:
- Phase 3C audit / snapshot