B3-F1c-g dot-dot-health Scheduler Repair — Patch Compilation Report
B3-F1c-g dot-dot-health Scheduler Repair — Patch Compilation Report
Session: B3-F1c-g (Birth, Phase 3d, Frame 1c-g) Date (UTC): 2026-05-14 Mode: COMPILE PATCH + ROLLBACK ONLY — no execution Author: Claude (Opus 4.7, 1M context) Artifacts produced:
knowledge/dev/laws/dieu44-trien-khai/artifacts/p3d-birth-b3f1c-g-dot-dot-health-scheduler-repair-patch.mdknowledge/dev/laws/dieu44-trien-khai/artifacts/p3d-birth-b3f1c-g-dot-dot-health-scheduler-repair-rollback.md
1. Hard-boundary attestation
| Boundary | Adhered |
|---|---|
| No file modification (source script) | YES — dot-dot-health was only read (Read tool); never edited |
| No cron modification | YES — cron not touched, not even inspected for writes |
| No PG mutation | YES — no run_pg, no psql, no docker exec invoked |
| No function invocation | YES — no script function called |
| No running dot-dot-health | YES — script not executed (not even --help) |
No running fn_birth_onboarding_full_scan |
YES — function untouched |
No system_health_checks INSERT |
YES — table untouched |
| No execution | YES — only Read + grep (read-only) for context |
Only read-only operations performed: find (locate file), Read (inspect script), grep on environment.sh (inspect env parser), crontab -l (read-only listing, returned no match — local mac has no cron entry for this DOT, as expected).
2. Defect summary
Reported: dot-dot-health cron broken — root cron passes --local, but parse_args rejects it.
Source inspection findings:
dot-dot-healthv1.0.0, 301 lines, atweb-test/dot/bin/dot-dot-health.- The inline "parse_args" is a
for arg in "$@"; caseblock at lines 96-100, matching only--help|-h. No default reject case exists in this local copy —--localwould fall through silently here. init_environment(web-test/dot/config/environment.sh:249-255) does accept--local|--cloudcorrectly.- Documented usage in script header (lines 21, 49):
dot-dot-health [--cloud|--local]— promise made but not enforced at the parse loop level. - Mutation path confirmed:
main()callslog_system_issue(curl POST to/items/system_issues) on every check failure; Check 2 also POSTs to/items/approval_requests. Source-time mutation risk via baremain "$@"(line 300) is real if another scriptsources this file.
VPS divergence caveat: The reported "parse_args rejects --local" symptom is not directly reproducible against the local clone (the case-statement falls through). The VPS-resident /opt/incomex/dot/bin/dot-dot-health likely has a stricter default case OR the failure manifests in a downstream call (init_environment, dot-auth, print_environment_banner) under root cron's minimal PATH. Reviewer must diff VPS source vs. local clone before applying. The patch is safe and correct either way — it's a no-op-or-fix.
3. Decision rationale (recommended_repair_option)
Selected: ADD_LOCAL_NOOP_FLAG
Per user directive and B3-MAINLINE-RESUME §3.7 convention:
- Multiple DOT scripts use
--localin root cron. - Removing
--localfrom this single cron line would diverge. - Adding
--local|--cloudas an accepted no-op (the case actually delegates toinit_environment "$@") is minimal, backward-compatible, and convention-preserving.
Both alternatives rejected with reasons documented in patch artifact §1.
4. Patch composition (compiled, not applied)
| Hunk | Location | Change | Lines added | Lines removed |
|---|---|---|---|---|
| H1 — parse_args no-op | line 96-100 | Add --local|--cloud) : ;; case (with explanatory comment) |
+1 (+1 reformat of --help line spacing) |
-1 (reformatted --help line) |
| H2 — safe source guard | line 300 | Wrap main "$@" in if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then ... fi |
+2 | -1 |
Net: +5 lines, -2 lines, no logic deletion, no behavior change for --help / bare exec / --cloud / --local direct invocation paths.
5. Verification plan compiled (NON-MUTATING)
Compiled in patch artifact §5:
- V1
bash -n— syntax check (parse-only, proven non-mutating) - V2 static grep on parse_args block (read-only)
- V3 static grep on safe source guard (read-only)
- V4
--helpinvocation — proven non-mutating by code-path analysis: the--helpcase fires insidemain()'s arg loop BEFOREinit_environment, BEFOREdot-auth, BEFORE any check /run_pg/log_system_issue/ curl.show_helpis stdout-only (heredoc +show_environment_helphelper). - V5 EXCLUDED — bare execution would run all 9 checks and POST to
system_issues+approval_requests. No--dry-runflag exists. Explicitly omitted from verification plan.
6. Rollback compilation
Three independent rollback paths compiled:
- R1 restore from
.bak.b3f1c-g.<UTC-timestamp>(recommended) - R2 reverse-apply unified diff
- R3 git revert
Per-hunk independent rollback also documented (with caveats — partial rollback re-opens defects). Rollback is byte-perfect reversible via R1.
7. Open items for GPT review
- Confirm VPS source matches local v1.0.0 (or quote VPS diff) before applying.
- Confirm cron line for
dot-dot-healthactually passes--local(and confirm no other surprising flags are passed under root cron's PATH/env). - Confirm
dot-authaccepts--localat line 112 — out of scope for this patch but adjacent. - Decide commit strategy — single commit covering both hunks, or two separate commits (one per hunk) for cleaner revert granularity.
- Confirm timing — applying outside cron tick window minimizes interference with a concurrent run.
8. Final status block
b3f1c_g_patch_compile_status=PASS
recommended_repair_option=ADD_LOCAL_NOOP_FLAG
safe_source_guard_included=true
patch_compiled=true
rollback_compiled=true
execution_allowed=false
next_recommended_action=GPT_REVIEW_PATCH_ARTIFACT