Establish facts about a repository before acting on assumptions about it.
Run
python3 scripts/repo_context.py --cwd <directory>
The script prints one JSON document. It runs only read-only git queries that execute
no repository-configured command, follows no symlink at any path component, skips
dependency and build directories, and never runs the commands it lists.
Read the result
| Field | Meaning |
|---|---|
source |
git (root, HEAD, branch, dirty counts) or archive-or-unversioned |
scan |
Depth/directory budget, directories visited, depth-pruned and count-truncated |
instructions |
Instruction and rule files with size and SHA-256; content is not copied |
ecosystems |
Per-directory Node, Python, Go and Makefile declarations |
commandCandidates |
argv + basis + executed: false; argv: null when blocked |
ci |
CI files present; gates is always null because files are not interpreted |
unknowns |
Fixed reason codes such as invalid-json, symlink-not-followed |
executionStillNeeded |
What must still be run or confirmed |
Reconcile before acting
- Read every listed instruction file. When instructions and discovered facts disagree, the instructions win; report the conflict instead of silently choosing.
- Treat
defaultBranch: null,ci.gates: nullandpackageManager: nullas unknowns to confirm from instructions or the user. Do not infer them from lockfiles, conventions orlocalOriginHead. dirty: nullwithdirty-state-uninspected-content-filtersmeans a tracked path is routed through a configured filter driver; checking it would run that driver's command, so it was not checked. Establish the state by a means you trust.- Treat every candidate as unverified until it runs. Record runs with the
verified-handoffskill so the result is backed by a receipt. - For an
archive-or-unversionedsource, describe the source explicitly (name and digest) wherever a commit would otherwise be cited. - Resolve each entry in
unknownsbefore relying on the declaration it affects;directory-scan-depth-limitordirectory-scan-count-limitmeans declarations may exist beyond the scanned tree.
Limits
- Discovery is bounded (depth 4, 5000 directories, 1 MiB per file).
_test.gocounts cover only the scanned tree. Submodule state is not inspected. - Declared facts are not installed facts: toolchain versions and dependencies must still be confirmed in the target environment.