[PR #6160] [MERGED] fix(process): index late scenario events in validation issues #7174

Closed
opened 2026-11-01 21:45:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6160
Author: @Abelo9996
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: fix-5966-late-event-index


📝 Commits (1)

  • ea96319 fix(process): index late scenario events in validation issues

📊 Changes

2 files changed (+29 additions, -2 deletions)

View changed files

📝 src/domain/process/processScenario.test.ts (+27 -0)
📝 src/domain/process/processScenario.ts (+2 -2)

📄 Description

Summary

Fixes #5966.

A process scenario with events scheduled after timeout_ms was rejected with one issue per late event, but every issue had path: ["events"] and the same message. Callers could not tell which entries to fix. Each issue now carries the event's index, ["events", index], and the message names the event time and the timeout. Classification (invalid_request / invalid_input) and the validation rule are unchanged. An event exactly at timeout_ms is still accepted.

Problem and expected behavior

In processScenarioSchema's per-event loop (src/domain/process/processScenario.ts), the timeout branch had index and event in scope but used path: ["events"]. The sibling checks in the same superRefine (event ordering and resize cell budget) already report ["events", index], and the resize message already includes at_ms.

Reproduction from the issue: timeout_ms: 1000 with events at 1500 and 2000, through node scripts/rea.mjs capture-process scenario.json --json. Before, exit 1:

[
  {"path":["events"],"reason":"invalid_value","message":"event occurs after the scenario timeout"},
  {"path":["events"],"reason":"invalid_value","message":"event occurs after the scenario timeout"}
]

Change and scope

Two lines in the schema. The path becomes ["events", index], and the message becomes event at <at_ms> ms occurs after the <timeout_ms> ms scenario timeout, matching the resize sibling's wording. The fix is in the schema that produces the issue, so the CLI and MCP adapters, which already project schema issues unchanged, need no changes.

Follow the contribution scope.
Scope decision: not applicable (ordinary fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: processScenarioSchema (domain), at request validation.
  • Contribution scope fit and linked maintainer decision: ordinary bug fix, not applicable.
  • CLI and MCP/tool-catalog contract: no schema shape change. details.issues[].path for late events gains the event index, and the message text includes the times.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none. The request is still rejected before any process is launched.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/domain/process/processScenario.test.ts, new test identifies each event scheduled after the scenario timeout. With timeout_ms: 1000 and events at 1000, 1500 and 2000, it expects exactly two issues, at ["events", 1] and ["events", 2], with their times in the messages. That also confirms the event at exactly the timeout is still accepted.

  • Base reproduction or other evidence (executed): with the new test and without the fix:

    × identifies each event scheduled after the scenario timeout
    -     "message": "event at 1500 ms occurs after the 1000 ms scenario timeout",
    +     "message": "event occurs after the scenario timeout",
          "path": [
            "events",
    -       1,
          ],
    ...
    Tests  1 failed | 15 passed (16)
    

    With the fix: Tests 16 passed (16).

  • User-visible CLI/MCP output (if applicable): same CLI reproduction after the fix, exit 1, code: "invalid_request", category: "invalid_input", details.operation: "capture_process_scenario":

    [
      {"path":["events",0],"reason":"invalid_value","message":"event at 1500 ms occurs after the 1000 ms scenario timeout"},
      {"path":["events",1],"reason":"invalid_value","message":"event at 2000 ms occurs after the 1000 ms scenario timeout"}
    ]
    
  • Remaining proof gaps: MCP transport was not exercised. It uses the same schema.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

(Not evidence-bearing: input validation diagnostics only.)

Validation performed

Run with the pinned Node 24.18.0 on macOS arm64.

  • npm run test:focused -- src/domain/process/processScenario.test.ts: 16 passed (1 failure without the fix, shown above)
  • npm run test:focused -- src/domain/process/processCapture.validation.test.ts src/process/capture/ProcessScenarioRuntimeValidation.test.ts tests/boundary/filesystem/processCliFileInput.test.ts src/domain/inputIssueProjection.test.ts: 57 passed
  • npm run check: exit 0 (typecheck, lint with 0 errors, format:check, knip, metadata:check, architecture guards)
  • node scripts/rea.mjs capture-process scenario.json --json on builds from npm run build:cached with and without the fix, output above

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Issue paths become more specific and the message text changes. Nothing in the repository matched the old message.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable. Validation fails before launch. Run on macOS.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no change to what is accepted or launched.

Author readiness

Human owner: @Abelo9996

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6160 **Author:** [@Abelo9996](https://github.com/Abelo9996) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix-5966-late-event-index` --- ### 📝 Commits (1) - [`ea96319`](https://github.com/morluto/rea/commit/ea963197f308762ede5b2adde25bc7d9e0ecf253) fix(process): index late scenario events in validation issues ### 📊 Changes **2 files changed** (+29 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/process/processScenario.test.ts` (+27 -0) 📝 `src/domain/process/processScenario.ts` (+2 -2) </details> ### 📄 Description ## Summary Fixes #5966. A process scenario with events scheduled after `timeout_ms` was rejected with one issue per late event, but every issue had `path: ["events"]` and the same message. Callers could not tell which entries to fix. Each issue now carries the event's index, `["events", index]`, and the message names the event time and the timeout. Classification (`invalid_request` / `invalid_input`) and the validation rule are unchanged. An event exactly at `timeout_ms` is still accepted. ## Problem and expected behavior In `processScenarioSchema`'s per-event loop (`src/domain/process/processScenario.ts`), the timeout branch had `index` and `event` in scope but used `path: ["events"]`. The sibling checks in the same `superRefine` (event ordering and resize cell budget) already report `["events", index]`, and the resize message already includes `at_ms`. Reproduction from the issue: `timeout_ms: 1000` with events at 1500 and 2000, through `node scripts/rea.mjs capture-process scenario.json --json`. Before, exit 1: ```json [ {"path":["events"],"reason":"invalid_value","message":"event occurs after the scenario timeout"}, {"path":["events"],"reason":"invalid_value","message":"event occurs after the scenario timeout"} ] ``` ## Change and scope Two lines in the schema. The path becomes `["events", index]`, and the message becomes `event at <at_ms> ms occurs after the <timeout_ms> ms scenario timeout`, matching the resize sibling's wording. The fix is in the schema that produces the issue, so the CLI and MCP adapters, which already project schema issues unchanged, need no changes. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Scope decision: not applicable (ordinary fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: `processScenarioSchema` (domain), at request validation. - Contribution scope fit and linked maintainer decision: ordinary bug fix, not applicable. - CLI and MCP/tool-catalog contract: no schema shape change. `details.issues[].path` for late events gains the event index, and the message text includes the times. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. The request is still rejected before any process is launched. - Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/domain/process/processScenario.test.ts`, new test `identifies each event scheduled after the scenario timeout`. With `timeout_ms: 1000` and events at 1000, 1500 and 2000, it expects exactly two issues, at `["events", 1]` and `["events", 2]`, with their times in the messages. That also confirms the event at exactly the timeout is still accepted. - Base reproduction or other evidence (executed): with the new test and without the fix: ``` × identifies each event scheduled after the scenario timeout - "message": "event at 1500 ms occurs after the 1000 ms scenario timeout", + "message": "event occurs after the scenario timeout", "path": [ "events", - 1, ], ... Tests 1 failed | 15 passed (16) ``` With the fix: `Tests 16 passed (16)`. - User-visible CLI/MCP output (if applicable): same CLI reproduction after the fix, exit 1, `code: "invalid_request"`, `category: "invalid_input"`, `details.operation: "capture_process_scenario"`: ```json [ {"path":["events",0],"reason":"invalid_value","message":"event at 1500 ms occurs after the 1000 ms scenario timeout"}, {"path":["events",1],"reason":"invalid_value","message":"event at 2000 ms occurs after the 1000 ms scenario timeout"} ] ``` - Remaining proof gaps: MCP transport was not exercised. It uses the same schema. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. (Not evidence-bearing: input validation diagnostics only.) ## Validation performed Run with the pinned Node 24.18.0 on macOS arm64. - `npm run test:focused -- src/domain/process/processScenario.test.ts`: 16 passed (1 failure without the fix, shown above) - `npm run test:focused -- src/domain/process/processCapture.validation.test.ts src/process/capture/ProcessScenarioRuntimeValidation.test.ts tests/boundary/filesystem/processCliFileInput.test.ts src/domain/inputIssueProjection.test.ts`: 57 passed - `npm run check`: exit 0 (typecheck, lint with 0 errors, format:check, knip, metadata:check, architecture guards) - `node scripts/rea.mjs capture-process scenario.json --json` on builds from `npm run build:cached` with and without the fix, output above ## Compatibility, safety, and release - Breaking changes or migration steps: none. Issue paths become more specific and the message text changes. Nothing in the repository matched the old message. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. Validation fails before launch. Run on macOS. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no change to what is accepted or launched. ## Author readiness Human owner: @Abelo9996 - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7174
No description provided.