Add pup show index forensic command#49
Merged
Merged
Conversation
Dumps the on-disk .pup/index in a grep-friendly form: file/command counts, per-edge-type totals, and a per-command listing of implicit and sticky deps. Used to diagnose whether a header's implicit-dep edge was ever recorded — the core forensic question for the transitive-dep tracking bug (see pup-header-detection-bug.md). Usage: pup show index - full dump (per-command implicit/sticky edges) pup show index --summary - counts only, including how many commands have any implicit/sticky deps recorded pup show index PATTERN - same as full dump but only commands whose command-string contains PATTERN Loads the index directly via discover_layout + read_index, without parsing Tupfiles. Useful for forensics even when the build graph is in a partially-broken state. Co-Authored-By: Claude Opus 4.7 (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
Adds
pup show index— a forensic command that dumps the on-disk.pup/indexin a grep-friendly form. The intended use is to answer "did pup record this implicit-dep edge?" — the core diagnostic question for the transitive-dep tracking bug under investigation (seepup-header-detection-bug.md).Usage
Example output:
Implementation
cmd_export_indexinsrc/cli/cmd_show.cppdispatched from the existingshow <format>mechanism. Joinsscript,compdb,graph,var,instructionsas the sixth format.discover_layout+read_index— does not parse Tupfiles. The forensic remains usable when the build graph is in a partially-broken state.options.cppsoshow index PATTERNparses the positional argument intoshow_var_filter(same slotshow var NAMEuses).print_usage()updated.Test plan
[e2e][show]SCENARIO (Show index dumps implicit-dep edges from the on-disk index) covers default output,--summarymode, and the positional filterbuild/directory: 832 files, 101 commands, 38054 implicit edges, all commands list their-MD-discovered headersmake formatcleanOnce
pup-header-detection-bug.md's reproducer is merged (PR #48), this command can be run on the broken state — e.g.pup show index PATTERN, look fornewhdr.hin the implicit list — to confirm whether the dep was ever recorded.🤖 Generated with Claude Code