Skip to content

feat(hac): scripts/measure_deleted_why_comments.py still lists 15 unmatched removed reason commen... - #470

Merged
thomashan merged 12 commits into
mainfrom
I-1796129577-hac-restore-why-src-batch2/P-1796129600-CLA-CO5.5/E-1796129718-CLA-CO5.5/_
Dec 2, 2026
Merged

thomashan merged 12 commits into
mainfrom
I-1796129577-hac-restore-why-src-batch2/P-1796129600-CLA-CO5.5/E-1796129718-CLA-CO5.5/_

Conversation

@thomashan

Copy link
Copy Markdown
Collaborator

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 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.

Key Changes

  • Implement 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.".

References

None

Plan & Validation Metadata

  • Plan ID: P-1796129600-CLA-CO5.5
  • Expected Value (EV): 21.88
  • Agent: claude-agent
  • Model: claude-opus-5-5

Holon Intent Agent and others added 8 commits December 1, 2026 12:53
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 thomashan left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✅ 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.

@thomashan
thomashan added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit c333bf4 Dec 2, 2026
18 of 20 checks passed
@thomashan
thomashan deleted the I-1796129577-hac-restore-why-src-batch2/P-1796129600-CLA-CO5.5/E-1796129718-CLA-CO5.5/_ branch December 2, 2026 22:46
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