Skip to content

docs: add contributor-workflow.md, track an AGENTS.md pointing at it - #802

Open
mparrett wants to merge 4 commits into
mainfrom
wt/contributor-workflow-doc
Open

docs: add contributor-workflow.md, track an AGENTS.md pointing at it#802
mparrett wants to merge 4 commits into
mainfrom
wt/contributor-workflow-doc

Conversation

@mparrett

@mparrett mparrett commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Why

The mechanics between a clone and a green PR are spread across the Makefile, go.yml, .pre-commit-config.yaml, and five docs. A contributor, or a coding agent, working on the implementation has to reassemble them each time. The rule most often missed, regenerate after editing pkg/rt/core/**/*.lg, surfaces only after an edit has silently done nothing. This PR adds one page that maps them and proposes tracking a short AGENTS.md that points at it.

This is a draft because tracking AGENTS.md reverses a deliberate choice. CLAUDE.md was gitignored on 2026-03-28 (cb5e4fc4), AGENTS.md on 2026-04-30 (37a135d2), and the 113-line CLAUDE.md that was still tracked came out on 2026-05-07 (9b1d56bd). The case for revisiting it: the file is 36 lines of pointers into docs/, not a second copy of the README; the repo already tracks agent material in .agents/skills/; and an untracked file goes stale unseen, since the copy I had locally still said CI could not detect a stale core_compiled.lgb. AGENTS.md is the name most coding agents read, so it holds the text, and CLAUDE.md is a one-line import of it so Claude Code reads the same text without a second copy. If the answer is still no, the docs page stands on its own and I will drop the second commit.

What changed

  • docs/contributor-workflow.md: the make targets and go test invocations CI runs, the generated-artifact rule, which files it commits and that pkg/rt/core_go_lowered/ is a gitignored build artifact, with a pointer to regenerating-generated-artifacts.md, where tests and docs go, the two native registration paths (ns.Def in lang.go and //lg:native via lgprimgen) and the three compile paths (direct, *ir-compile*, -tags gogen_ir), and a table of every job in go.yml with what it guards and its local equivalent. Added to the README topical map.
  • AGENTS.md: the pointer file described above. CLAUDE.md is the one-line @AGENTS.md import. The two .gitignore lines are removed.

Effect on existing clones

A checkout that has an untracked AGENTS.md or CLAUDE.md will have its next git pull refused with untracked working tree files would be overwritten by merge. Move or delete the local copy first; nothing else changes.

Verification

Every command and claim was checked against main at 638b4a6a: the Makefile targets, the thirteen jobs in go.yml and their steps, .gitignore for the lowered tree, TestGogenAOTDiff in test/e2e/ for what gogen-diff runs, scripts/check_test_location.py, the constructors in pkg/vm/native_func.go, TestGeneratedArtifactsAreFresh in pkg/genmanifest, and shadowed_registration_test.go. python3 scripts/docs_frontmatter_hook.py --check passes on the new page and the README; scripts/docs_status.py reports nothing new.

@mparrett
mparrett requested review from nnunley and nooga September 6, 2026 14:07
@mparrett

mparrett commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@nooga Thoughts on restoring CLAUDE.md in the repo?

@nooga

nooga commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@nooga Thoughts on restoring CLAUDE.md in the repo?

Honestly I forgot about those files a while ago. What's the reasoning behind bringing it back?

@mparrett

mparrett commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@nooga Thoughts on restoring CLAUDE.md in the repo?

Honestly I forgot about those files a while ago. What's the reasoning behind bringing it back?

The hypothesis is restoring the conventional AGENTS/CLAUDE indices would improve quality / reduce defects on contributor PRs. Not strictly necessary but recommended by Anthropic, and I suspect most new contributors would be using Claude code. I have a custom workspace with many supports, and rarely initiate development on a clean checkout, so any gap here would be masked for my own work. It's a small sample size but we do see some defects in contributor PRs. I don't have a super strong opinion here, but think it's would be a small net help with little downsides. Little risk of going stale if you keep them lean and pointed to the right dev docs and scripts. I wasn't sure if maybe the previous preference to exclude it was based on anti-AI sentiment, but that would be understandable.

@nooga

nooga commented Sep 7, 2026

Copy link
Copy Markdown
Owner

@mparrett that makes sense, green light from me!

@mparrett

mparrett commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

@nnunley thoughts? This wouldn't replace any of the hooks or other agentic tooling/workflow stuff we've discussed.

mparrett and others added 4 commits September 7, 2026 20:10
One page for the mechanics between a clone and a green PR: the make targets
and go test invocations CI actually runs, the generated-artifact rule, where
tests and docs go, the two native registration paths and three compile paths,
and a table of every job in go.yml with what it guards and its local
equivalent. Existing docs own the detail; this page points at them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
AGENTS.md points at docs/ instead of restating it: the one rule people
trip on (regenerate after .lg edits), where tests and docs go, the two
native registration paths and three compile paths, and upstream
etiquette. CLAUDE.md is the one-line @AGENTS.md import so Claude Code
loads the same file; other agents read AGENTS.md directly. Both were
gitignored since 2026-05; this un-ignores them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…diff is a differential run

pkg/rt/core_go_lowered/ is a build artifact (.gitignore: its self-lower is
wall-clock-nondeterministic), not a committed generated file, and the
gogen-diff job runs TestGogenAOTDiff over test/gold-aot fixtures rather
than comparing lowering output against a committed tree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…_*.lg and //lg:native markers

generated.manifest lists the IR tables and the annotated primitives as
inputs alongside pkg/rt/core; a doc that names only the core sources
sends an IR-table edit past the rule it exists to state.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mparrett
mparrett force-pushed the wt/contributor-workflow-doc branch from f029be0 to f52ed4e Compare September 8, 2026 03:10
@mparrett
mparrett marked this pull request as ready for review September 8, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants