Skip to content

docs: add .codegraph/basics.md as the org-standard agent entry point - #2381

Merged
carlos-alm merged 4 commits into
mainfrom
docs/codegraph-basics-md
Aug 10, 2026
Merged

carlos-alm merged 4 commits into
mainfrom
docs/codegraph-basics-md

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

What

Adds .codegraph/basics.md to this repo — the committed, agent-facing entry point that Optave's organization instructions tell every agent to look for. This is the reference implementation; 14 other Optave repos are getting the same file in parallel, and the repo-foundry bootstrap kit is being updated so new repos get it by default.

Why the .gitignore change matters

.codegraph/ was ignored wholesale. To commit basics.md while keeping the graph DB local, the rule must ignore the directory contents:

.codegraph/*
!.codegraph/basics.md

.codegraph/ (trailing slash) ignores the directory, and git then refuses to descend into it — which silently voids the negation. Verified empirically before writing this; the comment in .gitignore records it so nobody "simplifies" it back.

Note that git check-ignore -v .codegraph/basics.md exits 0 on the correct config, because the negation pattern counts as a match. git status --porcelain -uall is the check that actually tells you.

Contents

basics.md records verified numbers from a full self-build on codegraph 3.16.0 — nothing estimated:

Files / nodes / edges 1037 / 21,770 / 44,877
Build time (native) ~2.5s
Graph quality 87/100, caller coverage 79.1%
Cycles 2 file-level, 6 function-level

It also flags two things that would otherwise mislead a reader:

  • The -T dead-code count is inflated ~3x. 431 of the 647 -T symbols are hand-authored parser fixtures under tests/benchmarks/resolution/fixtures/, which -T does not exclude. Real figure is ~216. Tracked in roles --role dead -T: hand-authored test fixture directories aren't excluded, causing reachability noise #2256, where I've added the detail that the predicate is defined in three places that must move together — the issue body named only two.
  • The 34-language file count is fixtures, not product code. Real source is 343 TypeScript files under src/.

CLAUDE.md gets a pointer to the new file at the top of the existing Codegraph Workflow section rather than a duplicate command list, so the two can't drift.

Every Optave repo is getting a committed .codegraph/basics.md that agents read
to orient before touching unfamiliar code. This adds ours.

The .gitignore rule must ignore the directory *contents* (.codegraph/*), not the
directory (.codegraph/) — git refuses to descend into an ignored directory, which
silently voids the !.codegraph/basics.md negation. Verified empirically.

basics.md records verified numbers from a full self-build on 3.16.0 (1037 files,
21770 nodes, 44877 edges, 2 file-level cycles, quality 87/100) and flags that the
-T dead-code figure is inflated ~3x by test fixtures (#2256).
@greptile-apps

greptile-apps Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds the organization-standard Codegraph entry point and links it from the repository guidance.

  • Documents setup, common commands, repository structure, health baselines, and known analysis caveats in .codegraph/basics.md.
  • Adjusts .gitignore so the guidance file is tracked while generated Codegraph contents remain ignored.
  • Adds a focused pointer from CLAUDE.md to avoid duplicating the command reference.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
.codegraph/basics.md Adds the agent-facing Codegraph setup, workflow, repository baseline, and caveat reference.
.gitignore Replaces the directory-level ignore with a contents rule and explicit exception for the committed guidance file.
CLAUDE.md Links new agents to the standard Codegraph guidance without duplicating its command list.

Reviews (3): Last reviewed commit: "Merge branch 'main' into docs/codegraph-..." | Re-trigger Greptile

carlos-alm and others added 3 commits August 9, 2026 02:47
The stats 'coupling hotspots' fan-out conflates intra-file containment with
cross-file coupling: src/types.ts reports fan-out 1322 against 1323 symbols
declared in that file. codegraph map reports 0 outbound for the same file.

Swap the table to map-derived numbers and warn against substituting the stats
figure, since the two commands use similar labels for different metrics.
@carlos-alm
carlos-alm merged commit df2d621 into main Aug 10, 2026
12 checks passed
@carlos-alm
carlos-alm deleted the docs/codegraph-basics-md branch August 10, 2026 01:16
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant