feat: harvest git/gh refs into structured artifacts at close (0.26.5)#53
Merged
Conversation
Layer-2 of the "perfect pack at close" design. When a task closes, task_close (MCP) and close (CLI) now run a best-effort, deterministic git/gh harvest — current commit, branch, and PR URL (when gh is available) — and stamp them onto the close event as structured artifacts in meta["artifacts"]. index_event merges those with the existing text-scrape, so the resume pack renders real refs under Artifacts (commits/branches/PRs) instead of relying on the agent typing them into prose. No LLM, no judgment, never fails the close. New tj_core::harvest module (pure `build` + IO `harvest`), meta.artifacts merge in db::index_event, and an end-to-end CLI test that closes inside a git repo and asserts the branch lands in the pack. Bump 0.26.5. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Layer 2 of the "perfect pack at close" design: a closed task should already
read as a clickable ledger of what shipped, deterministically — no LLM.
When a task closes,
task_close(MCP) andclose(CLI) run a best-effortgit/gh harvest — current commit, branch, and PR URL (when
ghisavailable) — and stamp them onto the close event as structured artifacts in
meta["artifacts"].db::index_eventmerges those with the existingtext-scrape, so the resume pack renders real refs under Artifacts
(
commits:/branches:/PRs:) a month later, without depending on theagent having typed the refs into prose.
Best-effort and deterministic: no repo, no
gh, or a detached HEAD just yieldsfewer artifacts and never fails the close. No model, no judgment — the smart
gap-filling stays in the distiller, on the subscription.
Type of change
Test plan
harvest::buildkeep/drop unit tests (detached HEAD, empty, non-url)index_event_merges_structured_meta_artifacts(db merge)close_harvests_git_commit_and_branch_into_pack(E2E: close in a gitrepo → branch lands in the pack)
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --all-targets(all green)RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-depsCHANGELOG
## [0.26.5]; also corrected the 0.26.4 backlog-drain note.