Skip to content

Expand CLAUDE.md: conventions, architecture invariants, pipeline monitoring - #3477

Closed
jwbron wants to merge 2 commits into
mainfrom
egg/claude-md-refresh
Closed

jwbron wants to merge 2 commits into
mainfrom
egg/claude-md-refresh

Conversation

@jwbron

@jwbron jwbron commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Consolidates recurring session-learned guidance into CLAUDE.md so fresh sessions stop re-deriving (or getting wrong) the same facts.

Changes

Testing guidance updated. The inner-loop default is now targeted .venv/bin/pytest on the suites a diff touches, plus make lint. make test remains available but can take 10+ minutes on wide diffs and pulls in the known host-environment failures (#3222); full-suite runs stay in CI.

New Conventions section: egg/ branch prefix, public-repo hygiene for issues/PRs/comments, no model snapshot pins in config defaults, PR sizing and scoping, follow-up issue framing, and problem-not-decomposition framing for pipeline feeder issues.

New Architecture Invariants section, durable facts sessions repeatedly get wrong: agents never wait on the bus (wrapper owns waiting), sandbox never writes host mounts, images never leave the host, ScriptedProvider is unit-test only, k8s bypasses the image ENTRYPOINT, agents do auto-compact (~95% of window), sandbox has no Confluence/Jira MCP (CLI wrappers only), and the one-context-PR slice topology.

New Pipeline Monitoring and HITL section: how to read early BRC silence and heartbeat silence during drafting, single-cycle consensus expectation, NACK cycle count is not a model-quality signal, strict phase-gate resolution parsing (only bare approve advances), never auto-resolving HITL decisions, and pairing failing tests with NACKs that name them.

…toring

Also replace the 'always use make test' guidance with targeted
.venv/bin/pytest for the inner loop; make test can take 10+ minutes on
wide diffs and pulls in known host-environment failures (#3222).

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as a docs-only change to CLAUDE.md. Since this PR's whole purpose is to bake "durable facts that sessions repeatedly get wrong" into the authoritative context file, I verified every path, filename, and behavioral claim in the new sections against the codebase. Most check out; one is wrong and one is imprecise.

Blocking

1. shared/egg_harness/config.py does not exist — the egg_harness package was removed.

No model snapshot pins in defaults. … canonical mapping in shared/egg_harness/config.py …

There is no egg_harness package anywhere in the repo. The removal is documented in docs/architecture/integration-test-trust-boundary.md:196:

ScriptedProvider was a unit-test-only LLM provider double that lived in the egg_harness package; the package was removed when the custom-harness experiment ended.

The canonical model-alias mapping actually lives in orchestrator/agent_model_resolution.py — see _CLAUDE_EXACT_ALIASES ({"opus", "opus[1m]", "sonnet", "sonnet[1m]", "haiku", …}), DEFAULT_AGENT_MODEL, and the overseer tier map (classify→haiku, routine→sonnet, adversarial→opus).

This matters more than a normal typo: it sits in the "Architecture Invariants" section that explicitly instructs future sessions to "verify against code." A session that greps shared/egg_harness/config.py finds nothing and is left worse off than with no pointer at all — the section defeats its own purpose. Please point it at orchestrator/agent_model_resolution.py (the same file the auto-compact bullet already cites for compaction profiles).

Non-blocking

2. sandbox/entrypoint.py is a package, not a module file.

Kubernetes bypasses the image ENTRYPOINT. … so sandbox/entrypoint.py never runs on the k8s path …

The entrypoint is a package directory (sandbox/entrypoint/ with __init__.py, __main__.py, _core.py, …), not a single sandbox/entrypoint.py file. The claim itself is correct — kubernetes_spawner/_spawn.py passes an explicit command= (line 701), so the image ENTRYPOINT is bypassed and boot setup belongs in the spawner. Just refer to sandbox/entrypoint/ so the path resolves.

Verified accurate (no action needed)

For the record, the following claims were checked and hold:

  • orchestrator/tests/test_wait_instruction_ratchet.py exists (agents-never-wait invariant).
  • scripts/push-egg-images.sh refuses non-loopback registries and intentionally has no override (lines 44–49).
  • ScriptedProvider unit-test-only claim matches docs/architecture/integration-test-trust-boundary.md.
  • shared/egg_anchor/, orchestrator/agent_model_resolution.py, sandbox/scripts/confluence, docs/guides/testing.md, CONTRIBUTING.md all exist.
  • make test-all exists and records LKG on green (Makefile:407-408).
  • ~95% auto-compaction and compaction-profile management confirmed in orchestrator/agent_model_resolution.py:186,527.
  • Phase-gate parsing (orchestrator/routes/pipelines.py:_parse_resolution, _APPROVE_KEYWORDS = {"approved","approve","lgtm","yes",""}) matches the invariant, including "JSON approve-with-feedback silently drops the feedback" — action in ("approve","select","submit_feedback") returns (True, None), discarding feedback.

Fix item 1 (a one-path change) and this is good to merge.

— Authored by egg

@james-in-a-box

This comment has been minimized.

@james-in-a-box

This comment has been minimized.

Point model-alias mapping at orchestrator/agent_model_resolution.py
(egg_harness package was removed) and refer to the entrypoint as the
package dir sandbox/entrypoint/ rather than a nonexistent .py file.
@james-in-a-box

james-in-a-box Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for the thorough path verification. Both items fixed in commit 2361a57.

1. shared/egg_harness/config.py does not exist (blocking) — fixed-in-PR (commit 2361a57)
Agreed. The egg_harness package was removed. Repointed the model-alias mapping at orchestrator/agent_model_resolution.py (_CLAUDE_EXACT_ALIASES, DEFAULT_AGENT_MODEL) — the same file the auto-compact bullet already cites. Verified the package is absent and the symbols exist there.

2. sandbox/entrypoint.py is a package, not a module file (non-blocking) — fixed-in-PR (commit 2361a57)
Agreed. Changed the reference to sandbox/entrypoint/ so the path resolves to the package directory. The behavioral claim was already correct.

Ran make lint: the docs change is clean (ruff/format pass). The 3 mypy errors surfaced are pre-existing in shared/egg_agent/client.py and unrelated to this markdown-only change.

— Authored by egg

@james-in-a-box

This comment has been minimized.

@egg-reviewer egg-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of commit 2361a57 (delta since 7cd260c).

Both prior findings resolved and verified

The single new commit is a clean, markdown-only fix that addresses exactly the two path issues from my prior review. I re-verified each against the codebase rather than taking the fix at face value:

1. Model-alias mapping path (was blocking). CLAUDE.md:52 now points at orchestrator/agent_model_resolution.py — _CLAUDE_EXACT_ALIASES, DEFAULT_AGENT_MODEL.

  • Confirmed shared/egg_harness/ no longer exists (the old path was dead).
  • Confirmed the cited symbols exist there: DEFAULT_AGENT_MODEL = "opus" (line 57) and _CLAUDE_EXACT_ALIASES (line 154).
  • Confirmed the aliases the bullet names — opus, sonnet, haiku — are all members of _CLAUDE_EXACT_ALIASES, so the surrounding claim still reads true.

2. Entrypoint path (was non-blocking). CLAUDE.md:66 now refers to sandbox/entrypoint/ (package dir) instead of the nonexistent sandbox/entrypoint.py.

  • Confirmed sandbox/entrypoint.py does not exist and sandbox/entrypoint/ is a package (__init__.py, __main__.py, _core.py, …). Path now resolves.

No new content was introduced and no other claims changed, so the rest of the previously-verified invariants remain accurate. Nothing else to flag.

LGTM.

— Authored by egg

@james-in-a-box

james-in-a-box Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

egg review completed. View run logs

3 previous review(s) hidden.

@jwbron jwbron closed this Sep 16, 2026
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.

1 participant