Skip to content

Finish issue #71 current-vs-slicing experiment - #224

Merged
mohanagy merged 2 commits into
mainfrom
issue-71-current-vs-slicing-experiment
May 20, 2026
Merged

mohanagy merged 2 commits into
mainfrom
issue-71-current-vs-slicing-experiment

Conversation

@mohanagy

@mohanagy mohanagy commented May 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • replace the stale slicer-stub experiment scaffold with a runnable slice-v1 adapter and task-aware harness
  • retarget the experiment to the committed examples/demo-repo corpus and publish measured findings.md
  • harden the strategy scripts for macOS portability and a fairer lexical baseline

Testing

  • npm run typecheck
  • npm run build
  • npm run test:run

Closes #71

Summary by CodeRabbit

  • New Features

    • Added task-conditioned slicing support and a new "slice-v1" retrieval strategy; CLI adapters now accept a task argument.
  • Documentation

    • Refined experiment README, updated prompt set, scaffolded run instructions, and added a detailed findings report with recommendations and run metadata.
  • Chores

    • Removed obsolete slicer stub.
  • Tests

    • Expanded tests to validate the new strategy set, prompts, and findings report.

Review Change Stack

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b4a4f12e-c3f7-4596-aa58-24a4086d523d

📥 Commits

Reviewing files that changed from the base of the PR and between a933368 and 669ae3a.

📒 Files selected for processing (2)
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/current-graphify.sh
  • tests/unit/why-graphify-doc.test.ts

📝 Walkthrough

Walkthrough

This PR wires per-prompt --task through the experiment harness and adapters, adds a slice-v1 adapter (invoking current-graphify with --retrieval-strategy slice-v1), refreshes prompts/findings/README, updates token-estimation/meta.json behavior, and extends tests to validate the new strategy and report contents.

Changes

Task-conditioned slicing experiment report and harness

Layer / File(s) Summary
README: framing, adapter contract, how-to-run, reporting
docs/experiments/2026-05-10-current-vs-slicing/README.md
Refines scope/milestone wording, documents required --task adapter contract and task normalization behavior, expands How-to-run with concrete setup and updated examples, adds Recommendation row and updates honesty notes.
Prompts and findings report
docs/experiments/2026-05-10-current-vs-slicing/{prompts.json,findings.md}
Replaces prompts.json with eight domain-specific prompts across explain/debug/review/impact; adds findings.md with run config, aggregate metrics, prompt-by-prompt notes, and recommendation to keep current-graphify while tuning slice-v1.
Harness: run.sh task wiring and exec prompt
docs/experiments/2026-05-10-current-vs-slicing/run.sh
Collects prompt IDs with a while-read loop, extracts task+text per prompt, prepends Task: in --exec merged prompts, and changes run_strategy_for_prompt signature to accept and forward prompt_task as --task.
current-graphify pack flow and context rendering
docs/experiments/2026-05-10-current-vs-slicing/strategies/current-graphify.sh
Accepts --task and --retrieval-strategy, maps TASK→PACK_TASK, runs graphify-ts pack with derived pack task and retrieval strategy, refactors pack.json → context.txt renderer into a Node IIFE that deduplicates extracted text fields, and records est_tokens/file_count/strategy in meta.json.
slice-v1 adapter
docs/experiments/2026-05-10-current-vs-slicing/strategies/slice-v1.sh
New script validating required args and invoking current-graphify.sh with --retrieval-strategy slice-v1.
full-context & lexical-baseline adapters
docs/experiments/2026-05-10-current-vs-slicing/strategies/{full-context.sh,lexical-baseline.sh}
Both now require --task, include task in meta.json notes, and use token-estimation fallback with stderr diagnostic; lexical baseline uses case-insensitive rg invocation.
Token estimation & meta.json changes
docs/experiments/2026-05-10-current-vs-slicing/strategies/*
Adapters emit stderr when gpt-tokenizer is missing and fall back to char/4 token estimate; meta.json now includes est_tokens, file_count (where applicable), strategy, and notes with requested/effective tasks and retrieval_strategy.
Tests
tests/unit/why-graphify-doc.test.ts
Tests now read findings.md and the real slice-v1.sh, assert README and scripts reference slice-v1 (and not slicer-stub), cover adapter command-contracts for current/lexical/slice-v1/full, assert prompts.json content, and require findings Recommendation content.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • mohanagy/graphify-ts#86: Builds on the same "current-vs-slicing" harness; this PR updates the harness, strategies, prompts, and tests similarly.
  • mohanagy/graphify-ts#218: Related work that added task-aware pack behavior exercised by this harness.
  • mohanagy/graphify-ts#144: Prior PR implementing slice-v1 retrievalStrategy support that this adapter invokes.

Poem

A rabbit nudges files at dawn,
Tasks in pockets, slicing drawn,
Current packs and slice-v1 play,
Findings hop and charts relay. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically summarizes the main change: completing the experiment work for issue #71 (current vs slicing comparison).
Description check ✅ Passed The description covers key sections (Summary, Testing, Related issues/Closes) and aligns with the template, though some optional checklist items are not explicitly marked.
Linked Issues check ✅ Passed The PR successfully implements all core requirements from issue #71: replaces slicer-stub with runnable slice-v1 adapter, adds task-aware harness, targets demo-repo corpus, publishes findings.md with metrics and recommendations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #71: experiment harness/scripts, findings documentation, prompt datasets, and test updates validating the new experiment structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-71-current-vs-slicing-experiment

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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.

Inline comments:
In
`@docs/experiments/2026-05-10-current-vs-slicing/strategies/current-graphify.sh`:
- Around line 83-87: The pack walker currently pushes snippet content via
pushSnippet(o.snippet ?? o.body ?? o.claim ?? o.text) and then calls
Object.values(o).forEach(walk), causing the same snippet(s) to be processed
twice; fix this by skipping snippet-related properties when recursing: modify
the recursion so walk is not called on properties 'snippet', 'snippets', 'body',
'claim', or 'text' (or alternatively iterate keys and only call walk for keys
not in that set) so that pushSnippet handles snippet extraction and
Object.values(o).forEach(walk) does not duplicate them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f4003cdd-753f-491a-85ee-e50b222eb837

📥 Commits

Reviewing files that changed from the base of the PR and between e598b3c and a933368.

📒 Files selected for processing (10)
  • docs/experiments/2026-05-10-current-vs-slicing/README.md
  • docs/experiments/2026-05-10-current-vs-slicing/findings.md
  • docs/experiments/2026-05-10-current-vs-slicing/prompts.json
  • docs/experiments/2026-05-10-current-vs-slicing/run.sh
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/current-graphify.sh
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/full-context.sh
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/lexical-baseline.sh
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/slice-v1.sh
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/slicer-stub.sh
  • tests/unit/why-graphify-doc.test.ts
💤 Files with no reviewable changes (1)
  • docs/experiments/2026-05-10-current-vs-slicing/strategies/slicer-stub.sh

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mohanagy
mohanagy merged commit 3387a53 into main May 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Research spike: compare current graph retrieval vs task-conditioned program slicing

1 participant