Repository navigation
feat: add execution-slice output format - #216
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR implements execution-slice output format for runtime-generation context packs. It adds contract types for execution steps, builds an algorithm to construct ordered runtime slices from graph data, integrates slice generation into the retrieval pipeline, propagates execution slices through pack conversion and compaction, and validates the feature across command, strategy, and stdio tests. ChangesExecution-slice context pack feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/stdio-slice-surface.test.ts (1)
158-161: ⚡ Quick winAssert parsed
pack.execution_sliceshape instead of raw substring match.The current check can pass on incidental text matches. Parse
contextPackTextand assertpack.execution_slicedirectly.Suggested test tightening
- const contextPackText = ((contextPackResponse as { result?: { content?: Array<{ text: string }> } }).result?.content ?? [])[0]?.text ?? '' - - expect(contextPackText).toContain('"execution_slice"') + const contextPackText = ((contextPackResponse as { result?: { content?: Array<{ text: string }> } }).result?.content ?? [])[0]?.text ?? '' + const payload = JSON.parse(contextPackText) as { + pack?: { + execution_slice?: { + status?: string + steps?: Array<{ label?: string }> + } + } + } + + expect(payload.pack?.execution_slice).toEqual(expect.objectContaining({ + status: expect.any(String), + steps: expect.any(Array), + }))🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/stdio-slice-surface.test.ts` around lines 158 - 161, Replace the brittle substring assertion with a structured assertion: parse the string in contextPackText as JSON (e.g., JSON.parse(contextPackText)) into a variable like parsedPack, then assert the presence and shape of parsedPack.execution_slice (for example that parsedPack.execution_slice is an object and contains the expected keys/types) instead of using expect(contextPackText).toContain; use contextPackResponse and contextPackText to locate the value and validate parsedPack.execution_slice directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/stdio-slice-surface.test.ts`:
- Around line 158-161: Replace the brittle substring assertion with a structured
assertion: parse the string in contextPackText as JSON (e.g.,
JSON.parse(contextPackText)) into a variable like parsedPack, then assert the
presence and shape of parsedPack.execution_slice (for example that
parsedPack.execution_slice is an object and contains the expected keys/types)
instead of using expect(contextPackText).toContain; use contextPackResponse and
contextPackText to locate the value and validate parsedPack.execution_slice
directly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f57a8815-ea26-431b-8275-209b57832e94
📒 Files selected for processing (7)
CHANGELOG.mddocs/proof-workflows.mdsrc/contracts/context-pack.tssrc/runtime/retrieve.tstests/unit/context-pack-command.test.tstests/unit/retrieve-slice-v1.test.tstests/unit/stdio-slice-surface.test.ts
Summary
execution_slicefield to compact runtime-generation backend packs while preserving the existingslicemetadataTest Plan
Closes #164
Summary by CodeRabbit
New Features
Documentation