Skip to content

fix(execute): support builtin callbacks and bound execution work - #5

Draft
SMARK2022 wants to merge 1 commit into
dev1-smarkfrom
execute-result-recovery
Draft

SMARK2022 wants to merge 1 commit into
dev1-smarkfrom
execute-result-recovery

Conversation

@SMARK2022

@SMARK2022 SMARK2022 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Current scope

Do not merge. Exactly one commit (7b30ee38) on current dev1-smark (f37e94dd), preserving its title-generation and cache-recovery changes and PR #4. Compare: ahead 1 / behind 0, 20 intended files.

Explicitly authorized JS support

  • Supported built-ins work as callbacks through the existing restricted dispatcher (e.g. map(Math.floor), map(JSON.parse), promise/sort/replacement callbacks).
  • Array(...) and new Array(...) support numeric lengths and element lists, with sparse-array semantics.
  • Array.from(source, mapper) runs the mapper with value/index through the interpreter. No new thisArg binding framework.
  • Math methods respect fixed arity and existing safe number coercion.
  • Sparse skip loops remain interruptible under the existing execution timeout, without a new size cap.
  • Corrected the existing syntax capability statement and obsolete mapper/arrow-only rejection messages; no additional prompt constraints.

Retained minimal fixes and withdrawn overreach

  • Valid ripgrep records over 64 KiB no longer hard-fail; existing timeout, result/file/submatch caps and previews remain.
  • Oversized first read lines advance line-based pagination; subsequent-line and auxiliary budgets remain.
  • Shell programmatic content excludes display-only notices without bypassing compression/redaction.
  • No automatic display of unused child results. session/tools.ts is identical to the target branch. Failed Execute retains its existing displayed output and error; a small existing-test extension verifies undisplayed file contents are absent.
  • The earlier fetch/media, log/depth-limit, grep-budget expansions and 77 added codemode test lines remain withdrawn. No JS host functions or tool permissions are newly exposed.

Requested Execute limits

  • 1,024 tool calls, using existing synchronous admission so parallel calls cannot exceed the shared budget.
  • 100,000 cumulative explicit loop iterations across nested loops/functions/async frames per execution. A later Execute gets a fresh budget. All explicit loop forms are covered; array-method callbacks remain governed by existing execution timeouts rather than this syntactic loop counter.
  • Formal execution and permission preflight share named policy constants but have independent counters. The library option remains optional; existing timeout ownership is unchanged.

CI failure reconciliation

The failing run tested this PR against 8b6f0f3. Current target f37e94dd includes 9f911f0, which already fixes the compaction cancellation, daemon maintenance fixtures, SSE-overflow fixture and pagination regressions. This PR is rebased onto those fixes rather than duplicating unrelated changes.

All prior failed targeted cases pass locally (9 targeted + 3 daemon). The complete Cookie-response file passes 63 tests, 5 skipped. Its earlier extra-request failure did not reproduce; product logic and assertion semantics were not changed based on speculation.

Verification

  • Codemode: 378 passed; codemode typecheck passed.
  • Execute host: 68 passed, including 1,024/1,025 admission and 100,000-loop limits.
  • Prior CI failure targets: 12 passed; full Cookie file 63 passed / 5 skipped.
  • Independent budget review and git diff --check: passed.
  • Follow-up fixtures: 94 passed / 5 skipped, README 1 passed; independent recheck 83 passed / 5 skipped.
  • Previous head remote CI: 28/31 succeeded, including typecheck. Remaining failures were the obsolete README layout assertion and two shared-test-state leaks. The new single commit fixes only those test fixtures, not product behavior.
  • Local final opencode typecheck was attempted twice but killed by the environment (SIGKILL), without TypeScript diagnostics; the exact published head passed remote typecheck. New-head remote CI: 31/31 checks passed, including typecheck and Linux/macOS/Windows opencode test jobs.

The audit document records current scope and baseline. Head: 7b30ee38a025e7c7ae69d5de5fa8f7c7bff7005f. One commit, draft/open, not merged.

Latest CI fixture fixes

  • Preserve the target README content/layout; update its stale test to check the current migration and branch notices before installation.
  • Load real repository-tool code with the workspace SDK in an isolated fixture, avoiding concurrent .opencode/node_modules installation.
  • Scope voice fixture interception to the complete tested async chain. Background provider HEAD probes no longer pollute it; unexpected URLs inside the voice chain still count and remain asserted.

@SMARK2022 SMARK2022 changed the title fix(execute): 保留完整工具结果与失败回执 fix(execute): preserve completed results with minimal harness fixes Nov 12, 2026
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch 2 times, most recently from a4cc07a to f752430 Compare November 12, 2026 18:15
@SMARK2022 SMARK2022 changed the title fix(execute): preserve completed results with minimal harness fixes fix(tools): preserve valid data without displaying unused results Nov 12, 2026
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch from f752430 to c658f73 Compare November 12, 2026 19:43
@SMARK2022 SMARK2022 changed the title fix(tools): preserve valid data without displaying unused results fix(codemode): support builtin callbacks and array construction Nov 12, 2026
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch from c658f73 to 134e976 Compare November 13, 2026 12:33
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch from 134e976 to 3350150 Compare November 14, 2026 03:13
@SMARK2022 SMARK2022 changed the title fix(codemode): support builtin callbacks and array construction fix(execute): support builtin callbacks and bound execution work Nov 14, 2026
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch 4 times, most recently from d7a4d4a to 7b0bf11 Compare November 15, 2026 09:00
@SMARK2022
SMARK2022 force-pushed the execute-result-recovery branch from 7b0bf11 to cff9a35 Compare November 15, 2026 16:13
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