ce-compound: line-number citations go stale quickly, and are checked against the working tree even when it holds unrelated changes

Open
#2,083 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, typescript

Research direction

Start with skills/ce-compound/references/research.md Phase 1 and grounding-validation.md, then inspect validate-doc-claims.py to see how it handles paths and citation line suffixes. Trace how capture and refresh choose the tree used for code-behavior citations. Done when citations prefer symbol anchors where possible, verification uses and identifies the intended base tree, and refresh recognizes citations that still match the default branch.

Written by the indexing model from the issue text.

Description

ce-compound's capture step asks the drafter to "cite file:line alongside the claim" from the current tree (skills/ce-compound/references/research.md, Phase 1 draft step), and grounding-validation.md says code-behavior claims verify against the local working tree. This causes two problems.

  1. Line numbers go stale whenever lines are added or removed above them. In one repo using ce-compound, a single refresh pull request updated 70 learnings, most of them only to move line numbers, and a second branch existed just to update one learning's citations again. Neither change corrected anything a reader needed. The code had moved, and the numbers had not. validate-doc-claims.py strips :line suffixes before checking, so nothing flags a stale number until someone reads it.

  2. The working tree is not always the tree the learning will merge into. In a GitButler workspace, or any checkout with other unmerged work applied, the working tree includes changes that are not part of the learning's pull request. In one session, a capture wrote line numbers that were 4-7 lines off from the base branch, and a refresh investigation recommended "correcting" about ten citations that were right on the base branch to the working-tree values. On an ordinary feature branch this does not arise, because the learning merges with the code it cites.

Suggested changes:

  • Prefer symbol anchors (function, class, or config key names) over line numbers when citing code in a learning, and keep file:line for cases where no symbol identifies the spot.
  • When HEAD is not the default branch's tip, verify code-behavior citations against the merge base or the default branch, as validate-doc-claims.py already does for paths, and state which tree was used.
  • In refresh, do not classify a citation as drifted when it matches the default branch.
Dominant language
TypeScript
Stars
25.6k
Forks
2.1k
Avg merge
3h 57m
Merged PRs (30d)
170

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EveryInc/compound-engineering-plugin

All issues in EveryInc/compound-engineering-plugin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.