Skip to content

scripts/health.ts: typed-data counterpart to release-due for health brief rows - #851

Open
developerz-ai[bot] wants to merge 7 commits into
mainfrom
dz/scripts-health-ts-typed-data-counterpart-to--ab726870
Open

developerz-ai[bot] wants to merge 7 commits into
mainfrom
dz/scripts-health-ts-typed-data-counterpart-to--ab726870

Conversation

@developerz-ai

@developerz-ai developerz-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

The resumed health-script diff left the gate red on two steps.

  • typecheck: scripts/lib/health-rule.ts imported './lib/health-narrow' from inside
    scripts/lib/, resolving to the nonexistent scripts/lib/lib/; corrected to
    './health-narrow'.
  • lint: biome check's findings across the seven touched scripts/ files fixed exactly
    as reported; no hand reformatting.

No behavior change: the eight row verdicts, the X_HEALTH_ROW_UNREADABLE refusals and
both ratchet pin tables are untouched. guards.md, framework.manifest.json and
wiki/Error-Codes.md already match their generators (unit, errors and manifest steps
passed at the red gate).

Acceptance

  • typecheck step green: scripts/lib/health-rule.ts:6 resolves './health-narrow' (no TS2307, X_TYPECHECK_FAILED gone)
  • lint step green: bunx biome check . reports no findings on the seven scripts/ files this diff touches
  • bun test scripts/health.ts.test.ts passes over the split modules with behavior unchanged (healthy world = ok:true + data.rows; refutation = ok:false, X_HEALTH_ROW_UNREADABLE findings, no data)
  • unit, errors, filesize, boundaries and manifest steps stay green: pin counts, wiki/Error-Codes.md row and framework.manifest.json untouched
  • bun run scripts/guards-doc.ts --check reports no drift for docs/architecture/guards.md
  • .dz/briefs/health.md machine-verdict section still matches the script's data shape (conclusion, status, headSha, expectedSha, verdict per row)

Changes

  • scripts/lib/health-rule.ts (edit) — THE CERTAIN TYPECHECK FIX. Line 6 imports './lib/health-narrow' but this file lives INSIDE scripts/lib/ — resolves to nonexistent scripts/lib/lib/ (TS2307, the gate's X_TYPECHECK_FAILED). Change the specifier to './health-narrow'. Nothing else changes: the eight verdict functions, RowVerdict, ROW_IDS are byte-frozen (scripts/health.ts and its test read them; unit-step ratchets pin this file's state.latest !== state.version and its size). Then run the scoped biome check; if it names this file, apply exactly what it names.
  • scripts/lib/health-narrow.ts (edit) — Hold for biome findings only. The narrow* functions and document shapes moved here verbatim; no export, shape or sentence may change — scripts/health.ts's judges and the unit-step ratchets read them. If the scoped biome check names a format/lint finding here, apply exactly that; if it names nothing, leave untouched.
  • scripts/health.ts (edit) — Hold for biome findings only. Its import block is already correct at scripts/ depth. CRITICAL: lines 1-4 are the header guards-doc renders into docs/architecture/guards.md:45 — never reword them. Behavior frozen: refusal = ok:false, summary 'cannot tell', findings, no data. If the scoped biome check names a finding here, apply exactly that; otherwise leave untouched.
  • scripts/health.ts.test.ts (edit) — Hold for biome findings only. The per-row verdict pins (null conclusion, empty result, sha mismatch, healthy path) must survive verbatim. The Promise.reject(new TypeError(...)) at lines 428-429 is deliberate — the bare-throw ratchet (X_TEST_BARE_ERROR) counts throw forms; do not revert it. If the scoped biome check names a finding here, apply exactly that; otherwise leave untouched.
  • scripts/lib/proto-index-pins.ts (edit) — Expected NO change. The scripts row (count 27) verified consistent: the unit step runs protoIndexFindings via scripts/corpus-unscanned.test.ts and PASSED at the red gate, and no edit here changes the counted Record-read shape in scripts/health.ts. Touch only if the scoped biome check names a finding in it.
  • scripts/lib/secret-compare-pins.ts (edit) — Expected NO change. The row 'scripts/lib/health-rule.ts: state.latest !== state.version' (lines 358-364) matches health-rule.ts:244 exactly once, and the unit step's secretCompareFindings PASSED at the red gate. Touch only if the scoped biome check names a finding in it.
  • scripts/repo-scan-timeout.test.ts (edit) — Expected NO change. Its second test (lines 67-75) documents why health.ts.test.ts's comment-quoted 'repoRoot()' is asked of the mask, and the unit step PASSED at the red gate. Touch only if the scoped biome check names a finding in it.
  • .dz/briefs/health.md (edit) — Expected NO change. Verified: the Machine verdicts section (lines 38-53) matches scripts/health.ts's data shape (ok/findings/data.rows; RowVerdict fields conclusion/status/headSha/expectedSha/verdict; unverdicted = re-run never unhealthy), and the citation anchors at lines 15/17 pass the errors step (PASSED at the red gate). Read once; edit only on a real contradiction with the health editor's fixes — none is expected since behavior is frozen.
  • docs/architecture/guards.md (edit) — Expected NO change. Verified by deriving guards-doc's output: line 45 carries the exact header sentence of scripts/health.ts:2-4, the codes [X_CI_RUN_NOT_FOUND, X_HEALTH_ROW_UNREADABLE] exactly as codesIn+libImportsOf derive them, and the command fallback 'bun run scripts/health.ts'. Guards are discovered (collectGuards scans scripts/*.ts) and no script header changes in this task — biome never rewrites comment text. Do NOT hand-edit this generated page and do not run --write (it reads the health editor's files); report drift if found.
  • framework.manifest.json (edit) — Expected NO change. The manifest step PASSED at the red gate, so the file already matches what bun run manifest generates, including the X_HEALTH_ROW_UNREADABLE entry (lines 1873-1875). Excluded from biome (biome.json line 25). Never hand-edit — regeneration is the gate's own step, and no input to it changes in this plan.
  • wiki/Error-Codes.md (edit) — Expected NO change. The X_HEALTH_ROW_UNREADABLE row (line 1076) and summary entry (line 27) satisfy the errors step, which PASSED at the red gate; code, cause wording and fix ('bun run scripts/health.ts --json') match scripts/health.ts:40-45. The page is excluded from biome and is byte-frozen (copied to the GitHub wiki). Edit only if the health editor's report names a contradiction; none is expected.

Verification

bun run verify passed (exit 0) in 21m 27s.

Notes

Premises of the request the team disproved:

  • Earlier run chore(ci): bump the actions group across 1 directory with 6 updates #1's closing claim 'both gate failures fixed' is false for typecheck: scripts/lib/health-rule.ts:6 still imports './lib/health-narrow' from a file that lives IN scripts/lib/, resolving to nonexistent scripts/lib/lib/ (code_glob: no such dir) — the TS2307 behind the final gate's X_TYPECHECK_FAILED. Its '36 pass' scoped check must predate that last edit; do not trust it as current.
  • The request's premise that the brief is eight prose one-liners with no machine output describes the PRE-task tree: .dz/briefs/health.md:38-53 now carries the Machine verdicts section and scripts/health.ts (449 lines, eight rows) exists. This run finishes the resumed diff; it does not create the script.
  • The lint failure is NOT in the generated/doc files: biome.json:24-26 excludes framework.manifest.json and wiki/, and markdown is not scanned — it can only be one of the seven scripts/ .ts files, and the scoped biome check names it.

🤖 Opened by developerz.ai for task tsk_ab726870cb3d34dc6bd01624855d01c6 on developerz-ai/ultimate.

Raised automatically by the raw_task_triage lane.

🤖 developerz.ai, an automated agent, not a human — this PR is one slice of a stacked plan.
Dispatched automatically by the raw_task_triage lane
Model glm-5.3-flash on api.z.ai via native, funded by account_key
Ran on box hv-dedicated-ci-1
Cost ~$0.28 for 3.64M in / 176.2k out (estimate: list price x reported tokens, cached input at its cached rate)
Run timeline run_ef62f7e2a42a4da0a3ec827b94eed28d
Part 1/1 of plan rtk_4d2ad71cd2354cbe87d49d7155054274

The resumed health-script diff left the gate red on two steps.
- typecheck: scripts/lib/health-rule.ts imported './lib/health-narrow' from inside
  scripts/lib/, resolving to the nonexistent scripts/lib/lib/; corrected to
  './health-narrow'.
- lint: biome check's findings across the seven touched scripts/ files fixed exactly
  as reported; no hand reformatting.

No behavior change: the eight row verdicts, the X_HEALTH_ROW_UNREADABLE refusals and
both ratchet pin tables are untouched. guards.md, framework.manifest.json and
wiki/Error-Codes.md already match their generators (unit, errors and manifest steps
passed at the red gate).

Dz-Task-Id: tsk_ab726870cb3d34dc6bd01624855d01c6
@developerz-ai

developerz-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

scripts/health.ts: typed-data counterpart to release-due for health brief rows

Work landed on #851 — watching it toward merge.

23h10m · 319 tool calls · 120 messages

Sessions: coding run


🤖 developerz.ai, an automated agent, not a human — hv-dedicated-ci-1 (developerz-ai[bot]) · model glm-5.3-flash on api.z.ai

@developerz-ai developerz-ai Bot added dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:glm-5.3-flash developerz.ai: model that wrote this bot PR. dz/provider:api.z.ai developerz.ai: provider that served this bot PR. labels Oct 22, 2026
@developerz-ai

developerz-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

🟡 Reviewed

1 actionable comment(s) · grounded on your code

⏱ 1m 02s wall clock · gpt-6.1-sol via router · 4 model call(s) · 524 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review summary — 11 file(s), 6 finding(s).

Critical 0 · Major 2 · Minor 4 · Nit 0

[bot] completed: Reviewed the new eight-row health command and its contracts. Found execution, validation and evidence gaps that can prevent checkups, report false health or produce unactionable alarms.

File Findings
scripts/health.ts 1 major
scripts/health.ts.test.ts 2 minor
scripts/lib/health-rule.ts 1 major, 1 minor
wiki/Error-Codes.md 1 minor
  • CI checks were not shown to the reviewer — GitHub reported no checks on the commit under review, so this review judged the diff without a build result

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-5 — 552.2k in / 3.98k out over 16 calls; cost unknown: no price on record for router/gpt-6.1-sol.

Comment thread scripts/health.ts
Comment thread scripts/health.ts.test.ts Outdated
Comment thread scripts/health.ts.test.ts Outdated
Comment thread scripts/lib/health-rule.ts Outdated
Comment thread scripts/lib/health-rule.ts Outdated
Comment thread wiki/Error-Codes.md Outdated
…ts-health-ts-typed-data-counterpart-to--ab726870

# Conflicts:
#	framework.manifest.json

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review summary — 1 file(s), 0 finding(s).

Completed [bot]: the supplied diff updates only generated manifest metadata, adding X_HEALTH_ROW_UNREADABLE and refreshing the build ID; no reviewable source changes.

  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-2 — 164.2k in / 1.17k out over 7 calls; cost unknown: no price on record for router/gpt-6.1-sol.

@developerz-ai

developerz-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

A fix round is resolving this pull request's merge conflict with main. Nothing is needed from you right now.

  • Red on this head: no check is failing
  • What was done: Fix round tsk_48777416d22f4a204f7a3ed756eff225 is running: this pull request conflicts with its base branch main, so GitHub cannot merge it until the conflict is resolved.
  • What happens next: It merges the base branch into this branch, resolves the conflicting files and pushes (no force-push); CI and the review then run on the new head. If the conflict cannot be settled within the attempt budget, a person is asked.

Status for head fde4096a1d60. This comment is updated in place.

🤖 Posted by developerz.ai — an automated agent, not a human.

Follow-up intent: Address review findings on #851

Dz-Task-Id: tsk_151d32b3990751da76ee2261fbf34821

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review summary — 4 file(s), 0 finding(s).

[bot] completed: Fixes the Bun command prefix, rejects malformed tag-run data, requires release SHA evidence, and avoids duplicate deploy incidents. Tests and error docs match the changes; no defects found in the supplied increment.

  • CI checks were not shown to the reviewer — GitHub reported no checks on the commit under review, so this review judged the diff without a build result

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-6 — 134.1k in / 712 out over 3 calls; cost unknown: no price on record for router/gpt-6.1-sol.

…ts-health-ts-typed-data-counterpart-to--ab726870

# Conflicts:
#	framework.manifest.json
…ts-health-ts-typed-data-counterpart-to--ab726870
@developerz-ai

developerz-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

File fence widened for a CI fix. The fix_pr follow-up for this pull request needed to change file(s) this PR did not touch, to fix the failing check — reason given: gate (unit-1):

  • scripts/helm-drain.test.ts

Why: X_VERIFY_STEP_TIMEOUT names this file as the one still running when the unit step was killed: "still running when it was stopped: scripts/helm-drain.test.ts (bun test --parallel=3 --update-timings)". Its render() is the corpus's last Bun.spawnSync — a synchronous wait holds the worker's only thread, so when the helm render did not come back, neither the spawn's own 30s timeout nor bun's 180s per-test timeout could end it; its whole batch (69 files, batch 1 of 12) stalled at ~480s and batches 2-12 never ran, which also reds verify (X_VERIFY_MERGE_INCOMPLETE, shard 1 never arrived). The fix — awaiting the spawn with a raced deadline that kills the child and releases the pipes, the pattern scripts/lib/guard-load.test.ts:111-128 already uses — only exists in that file; raising stepTimeoutMs would not unbrick a wedged worker.

The platform granted it under the same area lock a new task takes (no other in-flight task holds these files), after checking the path is not a secret, CI configuration or a human-merge path.

Posted automatically by the developerz bot (AI-authored).

Follow-up intent: Fix failing CI on #851

Dz-Task-Id: tsk_1b5ccbd78ba1036938d4856adf788002

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review summary — 2 file(s), 1 finding(s).

Critical 0 · Major 1 · Minor 0 · Nit 0

completed [bot]: Reviewed the asynchronous Helm-render timeout change; its timeout cleanup cannot cancel the active pipe readers, leaving a hang risk when descendants retain the pipes.

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-6 — 244.7k in / 524 out over 4 calls; cost unknown: no price on record for router/gpt-6.1-sol.

Comment thread scripts/helm-drain.test.ts Outdated
Follow-up intent: Address review findings on #851

Dz-Task-Id: tsk_48777416d22f4a204f7a3ed756eff225

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:glm-5.3-flash developerz.ai: model that wrote this bot PR. dz/provider:api.z.ai developerz.ai: provider that served this bot PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants