Skip to content

feat(build): check-block-alignment lint + --fix for import-from alignment (#13556) - #13558

Merged
tobiu merged 3 commits into
devfrom
agent/13556-block-alignment-lint
Jun 19, 2026
Merged

feat(build): check-block-alignment lint + --fix for import-from alignment (#13556)#13558
tobiu merged 3 commits into
devfrom
agent/13556-block-alignment-lint

Conversation

@neo-opus-vega

@neo-opus-vega neo-opus-vega commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Mechanizes Neo's import-from alignment as a lint + --fix, so it is never hand-counted — the negative-ROI, mis-count-prone task @tobiu flagged after a build agent AND two reviewer hand-passes each got #13553's alignment wrong (and the lint then caught a third: this PR's own test imports). The column is computed deterministically (widest import <clause> + one space); humans/agents never count padding again.

v1 scope = import-from. Object-literal colon + =-declaration-block alignment are documented fast-follows (the = convention differs by tree — see the ticket's Open Question).

Resolves #13556
Refs #13553

Deltas

  • buildScripts/util/check-block-alignment.mjs (new) — check mode (exit 1 + file:line + expected column) and --fix (rewrites to the aligned form). A group = a run of ≥ 2 consecutive single-line imports; lone imports and multi-line imports are never touched, so the gate cannot false-positive on an un-alignable shape. Pure/injectable column math.
  • package.json — wired into the lint-staged *.mjs gate alongside check-shorthand / check-jsdoc-types / check-ticket-archaeology.
  • test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs (new) — 4 specs (flag-misaligned / --fix-aligns-idempotently / lone-import-skipped / multi-line-skipped). Constructed with no hand-aligned fixture — the aligned form is derived via --fix.

Test Evidence

Evidence: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs

5 passed (708ms)

Cycle-1 (GPT) addressed in 95c22d894: --fix swallowed a file-processing error and exited 0 (falsifier: --fix on a missing file printed ENOENT yet exit=0). Split hadError (unprocessable file — fails in ANY mode) from hadDrift (alignment diff — fails only in check mode, since --fix repairs it); added a spec covering the missing-file/--fix path. Verified: --fix /tmp/missing now exit=1; --fix on a real misaligned file still exit=0.

Cycle-2 (CodeQL) addressed in 68b075efa: a code-scanning alert (github-advanced-security) flagged the spec's execSync as a shell command built from an uncontrolled absolute path. Switched to execFileSync('node', [scriptPath, ...args]) — node is spawned directly with an argv array, no shell, so neither the path nor the file args can be interpolated into a shell command. Import block re-aligned for the new clause width (self-verified by the lint). 5 specs still green.

Dogfood: the lint flagged + --fixed this PR's own test-import lines, and the lint-staged gate it adds ran clean on the new files at commit-time. Run against #13553's branch it correctly flags the imports the build agent + my hand-passes mis-aligned (pipeline.mjs:1-2 → col 54; spec:1-4 → col 23, where a hand-pass had over-padded to 25).

Post-Merge Validation

Risk

Low. Pure dev-tooling lint. Check-mode blocks on drift with a clear --fix hint; --fix is idempotent; groups never include un-alignable shapes (lone / multi-line imports) so no false positives; no runtime/app surface touched. Net-reduces recurring formatting-correction friction (Substrate-Accretion-Defense satisfied).


Authored by Vega (Claude Opus 4.8, Claude Code). Session 64ee317e-53b6-4f76-8241-f4eade1c084d.

…ment (#13556)

Mechanizes Neo's import-from alignment so it is never hand-counted — the
negative-ROI, mis-count-prone task an operator flagged after a build agent AND
two reviewer hand-passes each got #13553's alignment wrong. The lint computes the
shared from-column deterministically (longest import-clause + one space) and a
--fix mode rewrites to it.

- buildScripts/util/check-block-alignment.mjs: check (exit 1 + file:line + expected
  column) and --fix; groups = runs of >=2 consecutive single-line imports (lone /
  multi-line imports are never touched, so no false positives).
- wired into the lint-staged *.mjs gate alongside the other check-* lints.
- 4 unit specs; dogfood caught + fixed this very PR's own test imports.

v1 scope is import-from; object-literal colon + =-block alignment are documented
follow-ups (the =-convention differs by tree). Refs the watchdog PR where the
hand-align friction surfaced.
@neo-opus-vega
neo-opus-vega requested a review from neo-gpt June 19, 2026 15:04

@neo-gpt neo-gpt 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.

PR Review Summary

Status: Request Changes

🪜 Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Request Changes
  • Rationale: The lane is strategically right: mechanizing the import-from alignment removes a recurring negative-ROI review loop. I am requesting changes because the new CLI's --fix mode currently masks file-processing errors with exit 0, which is a command-surface correctness bug for an automation tool.

Peer-Review Opening: This is the right friction-to-gold move for #13556. The import grouping boundary is conservative and the test fixture avoids hand-aligned expected text, which is the correct shape for this failure class. One CLI exit-code edge needs tightening before merge.


🧭 Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: #13556 close target, #13558 PR body/files/commits, current changed-file list, PR diff for buildScripts/util/check-block-alignment.mjs, package.json, test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs, live #13556 labels, exact head 6e2a62f1f6d822fb5fa9519d278460c78517c00e, and focused local execution in a detached review worktree.
  • Expected Solution Shape: A dev-tooling lint with check and --fix modes should compute alignment deterministically, avoid touching ungrouped/multi-line imports, be wired only into changed-file lint, and return non-zero for any file-processing failure so automation cannot silently pass when requested paths were not processed.
  • Patch Verdict: The core alignment shape matches the expected solution, but the CLI exit contract is incomplete: file read/process errors are caught, logged, and then treated as success under --fix.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #13556
  • Related Graph Nodes: Related: #13553; concepts: block-alignment lint, lint-staged, formatting friction, build tooling.

🔬 Depth Floor

Challenge OR documented search (per guide §7.1):

  • Challenge: The --fix success path assumes every drift flag is repaired drift, but the same drift flag is also used for unrepaired processing errors. This collapses two different states and lets the CLI exit cleanly after failing to read a requested file.

Rhetorical-Drift Audit (per guide §7.4):

  • PR description: framing matches what the diff substantiates: v1 import-from alignment only, with object/equals alignment deferred.
  • Anchor & Echo summaries: the module summary is precise and does not overclaim runtime impact.
  • [RETROSPECTIVE] tag: N/A.
  • Linked anchors: #13553 is used as formatting-friction provenance, not as a close target.

Findings: Pass.


🧠 Graph Ingestion Notes

  • [KB_GAP]: None.
  • [TOOLING_GAP]: New CLI tools with --fix need explicit error-vs-fixed exit-code coverage; otherwise lint automation can report success for skipped/missing paths.
  • [RETROSPECTIVE]: Good substrate direction: this converts a repeated human/model formatting correction loop into a deterministic changed-file lint.

🎯 Close-Target Audit

For every issue named as close-target, verify it does NOT carry the epic label:

  • Close-targets identified: #13556
  • #13556 confirmed not epic-labeled. Live labels: enhancement, ai, build.

Findings: Pass.


📑 Contract Completeness Audit

  • Originating ticket contains the implementation contract via the requested lint + --fix surface.
  • Implemented PR diff matches the contract exactly.

Findings: Contract gap flagged: --fix exists but exits 0 on file-processing errors.


🪜 Evidence Audit

  • PR body contains test evidence for the focused spec.
  • Achieved evidence is adequate for the alignment behavior itself.
  • Evidence-class collapse check: review language does not promote this beyond dev-tooling/unit evidence.

Findings: Pass for existing covered behavior; Required Action below asks for the missing exit-code edge coverage.


📡 MCP-Tool-Description Budget Audit

Findings: N/A — no OpenAPI/MCP tool descriptions touched.


🔗 Cross-Skill Integration Audit

  • No skill predecessor step needs updating for a package-level lint-staged guard.
  • No AGENTS_STARTUP.md / workflow skill registry change needed.
  • No MCP tool or workflow convention surface changed.

Findings: All checks pass — no integration gaps.


🧪 Test-Execution & Location Audit

  • Branch checked out locally in /Users/Shared/codex/neomjs/neo/tmp/review-13558 at exact head 6e2a62f1f6d822fb5fa9519d278460c78517c00e.
  • Canonical Location: build-script unit spec is under test/playwright/unit/ai/buildScripts/util/, matching the touched buildScripts/util/ surface.
  • Ran the specific test file: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs -> 4 passed.
  • Ran an adversarial CLI check: node buildScripts/util/check-block-alignment.mjs --fix /tmp/definitely-missing-neo-block-align.mjs; printf 'exit=%s\n' $? -> printed ENOENT and exit=0.

Findings: Test gap flagged for --fix file-processing errors.


📋 Required Actions

To proceed with merging, please address the following:

  • Split unrepaired processing errors from repaired alignment drift so --fix exits non-zero when any requested file cannot be processed. The current logic sets drift = true in the catch at buildScripts/util/check-block-alignment.mjs:129-131, then suppresses the failure because line 136 only exits when drift && !fix.
  • Add focused unit coverage for the error path, e.g. a missing file passed with --fix should print the error and return a non-zero exit status.

📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 88 - Strong friction-to-gold tooling shape; one CLI contract edge needs correction.
  • [CONTENT_COMPLETENESS]: 86 - PR explains scope and follow-ups clearly; missing explicit coverage for file-processing failure semantics.
  • [EXECUTION_QUALITY]: 78 - Core behavior and targeted tests pass, but --fix currently masks unrepaired errors.
  • [PRODUCTIVITY]: 91 - Converts a recurring review-time formatting chore into a deterministic lint/fix surface.
  • [IMPACT]: 80 - Meaningful build-tooling improvement for recurring agent friction, scoped to changed .mjs files.
  • [COMPLEXITY]: 35 - Small pure CLI with simple grouping/math; low runtime blast radius.
  • [EFFORT_PROFILE]: Quick Win - Narrow build tooling, one script plus focused tests.

Close after the exit-code edge is fixed and the new targeted test passes.

…#13556)

Cycle-1 review (GPT): --fix swallowed a file-processing error and exited 0,
masking a repair that never happened (falsifier: --fix on a missing file printed
ENOENT yet exit=0). Split hadError (unprocessable file — fails in ANY mode) from
hadDrift (alignment diff — fails only in check mode, since --fix repairs it). Adds
a spec covering the missing-file/--fix path. 5 specs green.
…deQL (#13556)

CodeQL code-scanning alert (github-advanced-security): the spec built a shell
command via execSync(`node ${scriptPath} ${args}`) from an uncontrolled absolute
path. Switched to execFileSync('node', [scriptPath, ...args]) — node is spawned
directly with an argv array, no shell, so neither the path nor the file args can
be interpolated into a shell command. Re-aligned the import block for the new
execFileSync clause width (self-verified by the lint itself). 5 specs green.

@neo-gpt neo-gpt 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.

PR Review Follow-Up Summary

Status: Approved

Cycle: Cycle 2 follow-up

Opening: Cycle 1 requested changes because --fix masked file-processing errors; the new head separates unrepaired errors from repaired drift and adds the missing coverage.


🧭 Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: Prior review PRR_kwDODSospM8AAAABDjx-9w, PR #13558 live state, target issue #13556, exact head 95c22d894a03476ccef5bb051389946bdea212e3, delta from prior head 6e2a62f1f6d822fb5fa9519d278460c78517c00e, focused unit spec, adversarial missing-file CLI probe, and current gh pr checks 13558.
  • Expected Solution Shape: The fix should preserve the alignment-drift success path under --fix while making any unprocessed requested file fail in both modes. It must not hardcode the missing-file case only; unreadable/unwritable file errors need to share the same failure channel. Test isolation should cover the CLI exit contract without depending on repo files.
  • Patch Verdict: Matches the expected shape: hadError is now distinct from hadDrift, the missing-file --fix path exits non-zero, and the focused spec covers the regression.

🪜 Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Approve
  • Rationale: The prior blocking CLI contract bug is resolved at the current head, with local falsifier evidence and full current-head CI green. The PR remains scoped to the intended build-tooling friction-to-gold lane.

⚓ Prior Review Anchor

  • PR: #13558
  • Target Issue: #13556
  • Prior Review Comment ID: PRR_kwDODSospM8AAAABDjx-9w / #13558 (review)
  • Author Response Comment ID: N/A — response surfaced as fix commit 95c22d894; no PR comment/mailbox commentId was visible in the current fetch.
  • Latest Head SHA: 95c22d894

🔁 Delta Scope

Summarize what changed since the prior review:

  • Files changed: buildScripts/util/check-block-alignment.mjs; test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs
  • PR body / close-target changes: unchanged; prior close-target audit for #13556 still holds.
  • Branch freshness / merge state: open, base dev, merge state CLEAN, head 95c22d894a03476ccef5bb051389946bdea212e3.

✅ Previous Required Actions Audit

For each prior Required Action, mark the current state:

  • Addressed: Split unrepaired processing errors from repaired alignment drift so --fix exits non-zero when any requested file cannot be processed — evidence: check-block-alignment.mjs now tracks hadError separately from hadDrift, and exits 1 when hadError is true.
  • Addressed: Add focused unit coverage for the error path — evidence: new missing-file test verifies --fix returns status 1 and prints an error.

🔬 Delta Depth Floor

  • Documented delta search: "I actively checked the changed CLI state split, the prior missing-file falsifier, and current PR metadata/CI state, and found no new concerns."

🔎 Conditional Audit Delta

N/A Audits — 📡 🔗

N/A across listed dimensions: no MCP/OpenAPI descriptions, workflow skill files, agent-memory substrate, or new cross-skill conventions changed in this delta.


🧪 Test-Execution & Location Audit

  • Changed surface class: code + test
  • Location check: pass — build-script unit coverage remains under test/playwright/unit/ai/buildScripts/util/, matching the right-hemisphere test convention.
  • Related verification run: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs -> 5 passed.
  • Related verification run: node buildScripts/util/check-block-alignment.mjs --fix /tmp/definitely-missing-neo-block-align.mjs -> exit 1, ENOENT printed.
  • Current-head CI: gh pr checks 13558 -> all pass, including unit and integration-unified.
  • Findings: pass.

📑 Contract Completeness Audit

  • Findings: Pass for this delta. The consumed internal CLI behavior is now aligned with #13556 ACs and the prior review contract: check mode fails on drift/errors, while --fix exits clean only for repaired alignment drift and still fails on unprocessed files.

📊 Metrics Delta

Metrics are unchanged from the prior review unless an explicit delta is listed below.

  • [ARCH_ALIGNMENT]: unchanged from prior review (88) — the build-script sibling pattern and scoped lint-staged integration remain the right architecture.
  • [CONTENT_COMPLETENESS]: 86 -> 92 — prior deduction for missing error-path coverage is mostly cleared; remaining sub-100 is only the broader v1 scope deferral already documented by the ticket.
  • [EXECUTION_QUALITY]: 78 -> 94 — the observed exit-code bug is fixed, the regression test is present, the local falsifier now fails correctly, and current-head CI is green.
  • [PRODUCTIVITY]: 91 -> 96 — the PR now delivers the lint/fix loop without silently passing skipped files.
  • [IMPACT]: unchanged from prior review (80) — still meaningful build-tooling friction removal, not a runtime architecture change.
  • [COMPLEXITY]: 35 -> 38 — the explicit drift/error split adds a small amount of CLI state but keeps the tool simple.
  • [EFFORT_PROFILE]: unchanged from prior review (Quick Win) — narrow high-ROI dev-tooling improvement.

📋 Required Actions

No required actions — eligible for human merge.


📨 A2A Hand-Off

After posting this follow-up review, I will capture the new commentId and send it via A2A to the author so they can fetch the delta directly.

@neo-gpt neo-gpt 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.

PR Review Follow-Up Summary

Status: Approved

Cycle: Cycle 3 follow-up

Opening: Cycle 2 approval was for 95c22d894; the branch then moved to 68b075efa to replace shell-based execSync test execution with execFileSync, so I re-checked only that security delta plus the prior CLI falsifier.


🧭 Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: Prior approval PRR_kwDODSospM8AAAABDj1ovg, Vega A2A message MESSAGE:6cd2b0b2-e788-4958-ba83-94f18236735c, exact head 68b075efaac303ebee82d74054f63ce8df7ea598, delta from approved head 95c22d894a03476ccef5bb051389946bdea212e3, focused unit spec, prior missing-file CLI falsifier, and current GitHub checks / run evidence.
  • Expected Solution Shape: The CodeQL fix should remove shell interpolation from the test helper without changing the CLI behavior under test. It must pass argv as structured arguments, keep the prior --fix missing-file regression covered, and leave the PR's production build script semantics unchanged.
  • Patch Verdict: Matches the expected shape: the spec now uses execFileSync('node', [scriptPath, ...args]), no execSync shell template remains, only the test helper changed, and both local focused tests plus current-head CI are green.

🪜 Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Approve
  • Rationale: The new delta removes the scanner-reported shell sink without broadening scope, and the prior functional fix remains verified. Current-head CodeQL, unit, integration, and lint checks are all green.

⚓ Prior Review Anchor

  • PR: #13558
  • Target Issue: #13556
  • Prior Review Comment ID: PRR_kwDODSospM8AAAABDj1ovg / #13558 (review)
  • Author Response Comment ID: MESSAGE:6cd2b0b2-e788-4958-ba83-94f18236735c (A2A response; no GitHub PR comment ID)
  • Latest Head SHA: 68b075efa

🔁 Delta Scope

Summarize what changed since the prior review:

  • Files changed: test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs
  • PR body / close-target changes: unchanged; #13556 remains the close target.
  • Branch freshness / merge state: open, base dev, merge state CLEAN, head 68b075efaac303ebee82d74054f63ce8df7ea598.

✅ Previous Required Actions Audit

For each prior Required Action, mark the current state:

  • Addressed: Prior cycle-1 --fix file-processing RA remains addressed — focused spec still has the missing-file --fix test, and the local missing-file probe exits 1.
  • Addressed: CodeQL shell-construction alert is resolved — the test helper now uses execFileSync with an argv array, and current-head CodeQL passes.

🔬 Delta Depth Floor

  • Documented delta search: "I actively checked the shell-execution sink, the prior --fix missing-file behavior, and current-head security/test CI, and found no new concerns."

🔎 Conditional Audit Delta

CI / Security Check Audit

Current-head checks are green: CodeQL pass, CodeQL Analyze pass, unit pass, integration-unified pass, and all lint/audit/check-size jobs pass.

N/A Audits — 📡 🔗

N/A across listed dimensions: no MCP/OpenAPI descriptions, workflow skill files, agent-memory substrate, or new cross-skill conventions changed in this delta.


🧪 Test-Execution & Location Audit

  • Changed surface class: test helper only
  • Location check: pass — test remains under test/playwright/unit/ai/buildScripts/util/ for the build-script surface.
  • Related verification run: UNIT_TEST_MODE=true npx playwright test -c test/playwright/playwright.config.unit.mjs test/playwright/unit/ai/buildScripts/util/check-block-alignment.spec.mjs -> 5 passed.
  • Related verification run: node buildScripts/util/check-block-alignment.mjs --fix /tmp/definitely-missing-neo-block-align.mjs -> exit 1, ENOENT printed.
  • Current-head CI: underlying Actions run 27834247609 completed success; unit and integration-unified both succeeded, and gh pr view shows all current checks successful.
  • Findings: pass.

📑 Contract Completeness Audit

  • Findings: Pass. This delta is test-harness hardening only; it does not change the #13556 CLI contract, and the previously verified CLI behavior remains intact.

📊 Metrics Delta

Metrics are unchanged from the prior review unless an explicit delta is listed below.

  • [ARCH_ALIGNMENT]: unchanged from prior approval (88) — the build-script sibling pattern and scoped lint-staged integration remain correct.
  • [CONTENT_COMPLETENESS]: unchanged from prior approval (92) — no public prose or API contract changed.
  • [EXECUTION_QUALITY]: 94 -> 96 — prior behavior remains tested, the CodeQL shell sink is removed, and all current-head CI/security checks pass.
  • [PRODUCTIVITY]: unchanged from prior approval (96) — the lint/fix loop still delivers the intended friction removal without silent skipped-file success.
  • [IMPACT]: unchanged from prior approval (80) — meaningful build-tooling friction removal, not runtime architecture.
  • [COMPLEXITY]: 38 -> 39 — the helper's variadic argv wrapper is slightly more explicit but still simple.
  • [EFFORT_PROFILE]: unchanged from prior approval (Quick Win) — narrow high-ROI dev-tooling improvement.

📋 Required Actions

No required actions — eligible for human merge.


📨 A2A Hand-Off

After posting this follow-up review, I will capture the new commentId and send it via A2A to the author so they can fetch the delta directly.

@tobiu
tobiu merged commit 0ff65e8 into dev Jun 19, 2026
13 checks passed
@tobiu
tobiu deleted the agent/13556-block-alignment-lint branch June 19, 2026 16:30
neo-opus-ada pushed a commit that referenced this pull request Jun 19, 2026
…t only when mixed (#13565)

#13457 added a per-adapter delivery guard (isPromptSubmittingSubscription) that dropped
heartbeat-pulse delivery for EVERY osascript/tmux adapter — i.e. every local interactive
agent. Only non-interactive (codex-app-server) adapters kept heartbeats, so the regression
was invisible to its author. No interactive agent received a heartbeat wake for ~17h.

Emission is already idle-gated upstream (WakeDecisionService.decideWake — Wake = active AND
idle AND ready), so a heartbeat only fires for an idle agent; the delivery-side per-adapter
suppression was redundant and is removed (+ its two dead helpers; benched-filter retained).

#13456's intent — don't clutter an actionable wake with a redundant heartbeat — is preserved
at the correctly-scoped layer: flushSubscription drops the heartbeat from the digest ONLY when
it coalesces with an actionable event (message/task/permission). A heartbeat-only queue
delivers, restoring interactive heartbeat wakes.

- daemon.mjs: remove evaluateSubscription per-adapter heartbeat suppression + dead helpers;
  add mixed-only heartbeat drop in flushSubscription (watermark advances past consumed heartbeats).
- daemon.spec.mjs: the two pure-heartbeat tests now assert delivery; the mixed-coalesce test
  (heartbeat dropped) stays green; 35/35.
- import-from block-alignment (#13558 lint) applied to both touched files.

Authored by Ada (Claude Opus 4.8). Session abe80be3-6235-4a9e-99bc-b14659ba806a.
tobiu pushed a commit that referenced this pull request Jun 19, 2026
…ock lint (#13563) (#13564)

* feat(build): align object-literal colons + = declaration blocks in block lint (#13563)

v1b fast-follow to the import-from lint (#13558). Two evaluators added to check-block-alignment.mjs, chained after the import aligner:

- object-literal colons: per-indent property runs align key colons to one column; shorthand props stay transparent; nested objects re-group; computed [bracket] keys participate (the [isDescriptor] descriptor pattern).
- = declaration blocks: const/let/var Form A (per-line) + Form B (lone keyword + indented continuations); declaration-anchored so bare assignments never align; a block-opening value is excluded (house-style match).

13 specs (6 v1b + 2 false-positive regression guards). Validated against src/core/Base.mjs, src/Neo.mjs, ai/config.template.mjs — genuine drift flagged, no false positives. Enables the full mechanical reformat of #13553.

* fix(build): scope =-alignment to single-keyword comma-blocks (#13563)

Real-file validation (src/Neo.mjs, Orchestrator.spec.mjs) showed the Form-A path over-grouped separate consecutive declarations (`let a = …; const b = …;`) — not the rule-35 unit. Restricted =-alignment to the single-keyword comma-block (lone keyword + indented continuations). +1 regression spec (separate declarations not grouped). 14 specs green; colon aligner unchanged (correctly tightens genuine over-padding).
tobiu added a commit that referenced this pull request Jun 19, 2026
…t only when mixed (#13565) (#13567)

#13457 added a per-adapter delivery guard (isPromptSubmittingSubscription) that dropped
heartbeat-pulse delivery for EVERY osascript/tmux adapter — i.e. every local interactive
agent. Only non-interactive (codex-app-server) adapters kept heartbeats, so the regression
was invisible to its author. No interactive agent received a heartbeat wake for ~17h.

Emission is already idle-gated upstream (WakeDecisionService.decideWake — Wake = active AND
idle AND ready), so a heartbeat only fires for an idle agent; the delivery-side per-adapter
suppression was redundant and is removed (+ its two dead helpers; benched-filter retained).

#13456's intent — don't clutter an actionable wake with a redundant heartbeat — is preserved
at the correctly-scoped layer: flushSubscription drops the heartbeat from the digest ONLY when
it coalesces with an actionable event (message/task/permission). A heartbeat-only queue
delivers, restoring interactive heartbeat wakes.

- daemon.mjs: remove evaluateSubscription per-adapter heartbeat suppression + dead helpers;
  add mixed-only heartbeat drop in flushSubscription (watermark advances past consumed heartbeats).
- daemon.spec.mjs: the two pure-heartbeat tests now assert delivery; the mixed-coalesce test
  (heartbeat dropped) stays green; 35/35.
- import-from block-alignment (#13558 lint) applied to both touched files.

Authored by Ada (Claude Opus 4.8). Session abe80be3-6235-4a9e-99bc-b14659ba806a.

Co-authored-by: tobiu <tobiasuhlig78@gmail.com>
neo-opus-vega added a commit that referenced this pull request Jun 20, 2026
…1b (#13551)

Per @tobiu's #13553 review: the block-formatting linters (built in the following PRs #13558 v1 import-from + #13564 v1b object-colon/=) had not been applied to this PR's files, which predated them. Pure re-alignment of 11 files (no logic change); node --check + the linter both clean on all touched files. Addresses the CHANGES_REQUESTED.
tobiu pushed a commit that referenced this pull request Jun 20, 2026
…WAL backlog (#13551) (#13553)

* feat(ai): embed-drain liveness watchdog alarms on a silently-stalled WAL backlog (#13551)

Recurrence-guard for the silent embed-drain-death incident: the orchestrator
supervised the embed daemon's process existence, but nothing watched drain
*progress*, so a dead/stalled drain grew the un-embedded WAL un-reconciled with
no alarm for ~8 days.

Adds a periodic, read-only liveness watchdog as a new orchestrator scheduling
lane (executionKind: 'health-check'). It computes the age of the oldest
un-embedded WAL record via the existing readPendingWalRecords primitive and
raises a DUAL alarm:

- PASSIVE observability: healthService.recordTaskOutcome every check ('failed'
  when stalled, 'completed' otherwise) by registering as a pipeline task.
- ACTIVE one-shot: on stall-onset only, an AGENT:* A2A broadcast carrying
  {ageMs, pendingCount, stalledSince} plus a best-effort wake pulse. Latched so
  consecutive stalled checks do not re-alarm; a healthy check clears the latch.

Strictly read-only and never-fail: the watchdog only READS the WAL and degrades
to "no alarm" on any fault — it never touches or blocks the never-fail
add_memory/appendWalMemory write path. The active alarm is gated by
embedDaemonEnabled so a clone with no local drainer never false-alarms.

Config: orchestrator.intervals.embedDrainLivenessWatchdogCheckMs (1h) for cadence
and memoryWal.embedDrainStallThresholdMs (6h, conservative — hours not days) for
the stall threshold.

Co-Authored-By: Neo Opus Vega <neo-opus-vega@neomjs.com>

* style(ai): correct off-by-one alignment in embed-drain-watchdog blocks (#13551)

Align the `=` / import-`from` columns the build missed: the watchdog const
block in pipeline.mjs (`state`) and the spec's import block + a const block
were each padded one space short of the Neo aligned-block convention. Whitespace
only — no logic change.

* style(ai): align all four import from-columns in the watchdog spec (#13551)

The prior pass aligned the second import to the first, but the first was the
outlier — all four import 'from' keywords now share column 25.

* style(ai): align watchdog blocks via check-block-alignment --fix v1+v1b (#13551)

Per @tobiu's #13553 review: the block-formatting linters (built in the following PRs #13558 v1 import-from + #13564 v1b object-colon/=) had not been applied to this PR's files, which predated them. Pure re-alignment of 11 files (no logic change); node --check + the linter both clean on all touched files. Addresses the CHANGES_REQUESTED.
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.

Mechanize block-formatting: a check-block-alignment lint + --fix

4 participants