Repository navigation
feat(hac): scripts/measure_deleted_why_comments.py still lists 15 unmatched removed reason commen... - #470
Open
thomashan wants to merge 12 commits into
Conversation
Description: scripts/measure_deleted_why_comments.py still lists 15 unmatched removed reason comments across 8 non-overlapping source modules that currently hold zero '# why:' lines on origin/main: apps/sandbox-executor/src/sandbox_executor/launcher/containers.py (4 entries, 266/350 lines), apps/sandbox-executor/src/sandbox_executor/launcher/antigravity_mounts.py (1 entry, 4/350 lines), apps/sandbox-executor/src/sandbox_executor/agent_defaults.py (3 entries, 340/494 lines), apps/sandbox-executor/src/sandbox_executor/budgets.py (3 entries, 260/350 lines), apps/sandbox-executor/src/sandbox_executor/flow/github/adapter.py (1 entry, 139/350 lines), apps/sandbox-executor/src/sandbox_executor/flow/github/pr.py (1 entry, 184/350 lines), apps/sandbox-executor/src/sandbox_executor/config_env_keys.py (1 entry, 111/350 lines), and apps/sandbox-executor/src/sandbox_executor/git.py (1 entry, 432/435 lines). The entries are: launcher/containers.py old line 57: "Attach to a proxy the user already runs (the flow's port-probe hit); never spawns a sidecar."; old line 89: "so every remaining exit path — early returns included — must run teardown, not just the final"; old line 98: "A forwarded HOLON_* value may hold a non-UTF-8 byte (surrogateescape); it must not crash the run here."; old line 169: "rather than a traceback, and never fall back to passing the credentials on the argv."; launcher/antigravity_mounts.py old line 6: "brain/ and conversations/ must be writable for agy's OnTaskCompleted background-task wakeup and runtime state." (re-exports ANTIGRAVITY_WRITABLE_TMPFS from runners/antigravity.py); agent_defaults.py old line 33: "These describe what produced those records, so they must never follow runtime detection or the current defaults."; old line 46: "flow. A ticker is never reassigned or reused, and there is no fallback: a runner without one (codex,"; old line 364: "Variables that never count as harness markers even when they match a prefix: they are credentials or user"; budgets.py old line 61: "iteration budget above, so a slow CI runner never consumes reviewer time."; old line 431: "Only a timer built in code can get here (load_budgets never yields a non-finite budget); hand nothing down" (stage_budget_handdown_env is now re-exported from budgets_timer.py); old line 447: "forwarded). The feedback is transient: it is never written to a ledger."; flow/github/adapter.py old line 37: "The only ``gh pr merge`` method flags the adapter runs; never ``--rebase``, ``--auto`` or ``--admin``."; flow/github/pr.py old line 166: "Gate: both refs must resolve to commits before a merge is simulated. merge-tree exits 1 for an"; config_env_keys.py old line 96: "Keys the host sets for a role container, or a maintainer sets for one run; a layer file never needs them, and the"; git.py old line 474: "never count as code in the guard, the review diff summary or calibration.". Goal: Restore each of the 15 lost reasons as a concise '# why:' comment across the 8 source modules (apps/sandbox-executor/src/sandbox_executor/launcher/containers.py, apps/sandbox-executor/src/sandbox_executor/launcher/antigravity_mounts.py, apps/sandbox-executor/src/sandbox_executor/agent_defaults.py, apps/sandbox-executor/src/sandbox_executor/budgets.py, apps/sandbox-executor/src/sandbox_executor/flow/github/adapter.py, apps/sandbox-executor/src/sandbox_executor/flow/github/pr.py, apps/sandbox-executor/src/sandbox_executor/config_env_keys.py, and apps/sandbox-executor/src/sandbox_executor/git.py), or record in the execution notes, per entry, why the code already shows it or moved out of scope. Keep edits strictly comment-only within these 8 files: no statement, name, string, import, or blank-line logic changes, and leave ast.dump(ast.parse(...)) of every module identical to origin/main. Keep git.py within its 435-line limit (432 lines currently; use a trailing '# why:' comment <= 120 chars on '*EMPTY_DIFF_EXCLUDES,' or stay <= 435 lines), keep agent_defaults.py within 494 lines and the other 6 modules within 350 lines, and never modify holon-config/hygiene/module_budgets.json. Where a symbol is now defined in an out-of-scope module and re-exported in scope (ANTIGRAVITY_WRITABLE_TMPFS in launcher/antigravity_mounts.py and stage_budget_handdown_env in budgets.py), place the '# why:' comment beside the re-export or outside the sorted import block (never split a sorted import group in a way that triggers ruff I001) or document the moved definition in execution notes; never edit files outside scope. Add or change no test file: apps/sandbox-executor/tests/test_self_doc_modules.py already allows '# why:' comments on all 8 governed modules. Verify with ruff format --check, ruff check, scripts/check_module_budgets.py, scripts/check_self_explaining.py, and the unit test suite. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show. Generated by Holon Intent Agent at 2026-12-01T12:53:04Z
…estore-why-src-batch2/P-1796129600-CLA-CO5.5/_
Action-Origin: pr_review Review-Iteration: 1 Review-Finding-Ids: R1-F1, R3-F1 Review-Severity: nit
Action-Origin: pr_review Review-Iteration: 1
Action-Origin: pr_review Review-Iteration: 2
thomashan
commented
Dec 1, 2026
thomashan
left a comment
Collaborator
Author
There was a problem hiding this comment.
✅ Ensemble Consensus Review — APPROVED (3/3)
Reviewed hac-restore-why-src-batch2 at a3659753 against main: 0 critical, 0 important and 0 nit findings; CI passing; mergeability CLEAN.
Role reviews:
| Role (activated) | Verdict | Review |
|---|---|---|
| Engineering | PASS | Confirmed AST-identical modules, comment placement beside owning symbols, ruff clean and module budgets intact including git.py at 432/435. |
| Documentation | PASS | All 15 restored comments use '# why:' and record constraints the code cannot show; self-explaining check passes. |
Verified:
- Module budgets hold and budget config is untouched —
scripts/check_module_budgets.py - Module line budgets hold, git.py at 432/435 —
scripts/check_module_budgets.py - Added comments satisfy the self-explaining rule —
scripts/check_self_explaining.py - why comments are allowed on the governed modules —
apps/sandbox-executor/tests/test_self_doc_modules.py - Module line budgets respected, git.py stays at 432/435 —
scripts/check_module_budgets.py
Checks: Mergeability CLEAN · CI 16/16 passed, 0 failing, 0 pending (source: ci_head)
Covers head a365975; change fingerprint pf2:83c2e9708f0a; CI at that commit: 16 of 16 checks passed.
🗳️ Ensemble Review Breakdown
- Reviewer 1 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Reviewer 2 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Reviewer 3 (
claude-agent / claude-opus-5-5):APPROVED(critical: 0, important: 0, nit: 0) - Ensemble Consensus Verdict:
APPROVED
Reviewed by claude-agent (3-Agent Ensemble) · Model claude-opus-5-5
Stage 5 calibration will be added to this PR before merge. Merging remains with the human maintainer.
Action-Origin: pr_review Review-Iteration: 3
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
scripts/measure_deleted_why_comments.py still lists 15 unmatched removed reason comments across 8 non-overlapping source modules that currently hold zero '# why:' lines on origin/main: apps/sandbox-executor/src/sandbox_executor/launcher/containers.py (4 entries, 266/350 lines), apps/sandbox-executor/src/sandbox_executor/launcher/antigravity_mounts.py (1 entry, 4/350 lines), apps/sandbox-executor/src/sandbox_executor/agent_defaults.py (3 entries, 340/494 lines), apps/sandbox-executor/src/sandbox_executor/budgets.py (3 entries, 260/350 lines), apps/sandbox-executor/src/sandbox_executor/flow/github/adapter.py (1 entry, 139/350 lines), apps/sandbox-executor/src/sandbox_executor/flow/github/pr.py (1 entry, 184/350 lines), apps/sandbox-executor/src/sandbox_executor/config_env_keys.py (1 entry, 111/350 lines), and apps/sandbox-executor/src/sandbox_executor/git.py (1 entry, 432/435 lines). The entries are: launcher/containers.py old line 57: "Attach to a proxy the user already runs (the flow's port-probe hit); never spawns a sidecar."; old line 89: "so every remaining exit path — early returns included — must run teardown, not just the final"; old line 98: "A forwarded HOLON_* value may hold a non-UTF-8 byte (surrogateescape); it must not crash the run here."; old line 169: "rather than a traceback, and never fall back to passing the credentials on the argv."; launcher/antigravity_mounts.py old line 6: "brain/ and conversations/ must be writable for agy's OnTaskCompleted background-task wakeup and runtime state." (re-exports ANTIGRAVITY_WRITABLE_TMPFS from runners/antigravity.py); agent_defaults.py old line 33: "These describe what produced those records, so they must never follow runtime detection or the current defaults."; old line 46: "flow. A ticker is never reassigned or reused, and there is no fallback: a runner without one (codex,"; old line 364: "Variables that never count as harness markers even when they match a prefix: they are credentials or user"; budgets.py old line 61: "iteration budget above, so a slow CI runner never consumes reviewer time."; old line 431: "Only a timer built in code can get here (load_budgets never yields a non-finite budget); hand nothing down" (stage_budget_handdown_env is now re-exported from budgets_timer.py); old line 447: "forwarded). The feedback is transient: it is never written to a ledger."; flow/github/adapter.py old line 37: "The only
gh pr mergemethod flags the adapter runs; never--rebase,--autoor--admin."; flow/github/pr.py old line 166: "Gate: both refs must resolve to commits before a merge is simulated. merge-tree exits 1 for an"; config_env_keys.py old line 96: "Keys the host sets for a role container, or a maintainer sets for one run; a layer file never needs them, and the"; git.py old line 474: "never count as code in the guard, the review diff summary or calibration.".Goal:
Restore each of the 15 lost reasons as a concise '# why:' comment across the 8 source modules (apps/sandbox-executor/src/sandbox_executor/launcher/containers.py, apps/sandbox-executor/src/sandbox_executor/launcher/antigravity_mounts.py, apps/sandbox-executor/src/sandbox_executor/agent_defaults.py, apps/sandbox-executor/src/sandbox_executor/budgets.py, apps/sandbox-executor/src/sandbox_executor/flow/github/adapter.py, apps/sandbox-executor/src/sandbox_executor/flow/github/pr.py, apps/sandbox-executor/src/sandbox_executor/config_env_keys.py, and apps/sandbox-executor/src/sandbox_executor/git.py), or record in the execution notes, per entry, why the code already shows it or moved out of scope. Keep edits strictly comment-only within these 8 files: no statement, name, string, import, or blank-line logic changes, and leave ast.dump(ast.parse(...)) of every module identical to origin/main. Keep git.py within its 435-line limit (432 lines currently; use a trailing '# why:' comment <= 120 chars on '*EMPTY_DIFF_EXCLUDES,' or stay <= 435 lines), keep agent_defaults.py within 494 lines and the other 6 modules within 350 lines, and never modify holon-config/hygiene/module_budgets.json. Where a symbol is now defined in an out-of-scope module and re-exported in scope (ANTIGRAVITY_WRITABLE_TMPFS in launcher/antigravity_mounts.py and stage_budget_handdown_env in budgets.py), place the '# why:' comment beside the re-export or outside the sorted import block (never split a sorted import group in a way that triggers ruff I001) or document the moved definition in execution notes; never edit files outside scope. Add or change no test file: apps/sandbox-executor/tests/test_self_doc_modules.py already allows '# why:' comments on all 8 governed modules. Verify with ruff format --check, ruff check, scripts/check_module_budgets.py, scripts/check_self_explaining.py, and the unit test suite. Code is self-explaining: no docstrings and no comments except '# why:' comments that record a reason the code cannot show.
Key Changes
gh pr mergemethod flags the adapter runs; never--rebase,--autoor--admin."; flow/github/pr.py old line 166: "Gate: both refs must resolve to commits before a merge is simulated. merge-tree exits 1 for an"; config_env_keys.py old line 96: "Keys the host sets for a role container, or a maintainer sets for one run; a layer file never needs them, and the"; git.py old line 474: "never count as code in the guard, the review diff summary or calibration.".References
None
Plan & Validation Metadata
P-1796129600-CLA-CO5.521.88claude-agentclaude-opus-5-5