Commit Graph
1235 Commits
Author SHA1 Message Date
gensokyo-dev 9868f2573c chore: reconcile author environment export followups 2026-10-19 19:47:37 +00:00
gensokyo-dev d31da9cc17 fix(environment): share authenticated input snapshots and preflight exported catalogs 2026-10-19 19:47:02 +00:00
Edgar ArakelyanandClaude Opus 5.5 9f0116f7ee fix(environment): reserve heap for every loading copy and refuse Windows device names
Export's headroom check reserved one native parse per input, while the
raw parse, its authenticated Evidence copy and the schema copy of its
result are live together while the pair loads; it now reserves all
three, so a file near the heap limit is refused as a resource
constraint rather than exhausting the heap.

A bundle name that Windows reserves as a device name (con, prn, aux,
nul, com1-com9, lpt1-lpt9) is refused while planning, before any file
is written, since the env folder could not be created there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:44:10 -07:00
Edgar Arakelyan 1367661547 chore: merge main (10f1994f) into environment export after the serve merge 2026-10-19 12:23:39 -07:00
Edgar ArakelyanandClaude Opus 5.5 405f366a80 chore: merge environment serve's final head (a215627e) into environment export
The serve change now loads environmentSource lazily so CLI startup never
imports it; the export command does the same, and the unused static
import is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:22:53 -07:00
gensokyo-dev 510142a041 chore: update environment export with latest main
# Conflicts:
#	docs/agent-environments.md
#	docs/cli.md
#	docs/specs/agent-environments/environment-serve/spec.md
#	src/application/environment/environmentReplay.test.ts
#	src/application/environment/environmentReplay.ts
#	src/application/environment/environmentSource.ts
#	src/application/environment/environmentTools.test.ts
#	src/application/environment/environmentTools.ts
#	src/cli/environmentCommands.ts
#	src/cliCommandNames.ts
#	src/server/environment/serveEnvironment.test.ts
#	src/server/environment/serveEnvironment.ts
#	tests/boundary/cli/cliStartupImports.test.ts
#	tests/boundary/cli/environmentServeCli.test.ts
#	tests/boundary/process/environmentServeShutdown.test.ts
#	tests/fixtures/environmentServe.ts
2026-10-19 19:17:51 +00:00
10f1994fe1 feat(environment): serve an environment manifest as a replay environment (#4975)
Serve retained capture Evidence as a bounded MCP replay environment with discovery.
Preserve default stdio, caller-selected facts and complete source Evidence.

Fix numeric fidelity, argument identity, startup cancellation and bounded discovery,
query/path matching and output metadata. Verify real recorded API data and public
CLI/MCP workflows; preserve explicit gaps for Windows and third-party hosts.

Co-authored-by: Edgar Arakelyan <edgar.arakelyan@scale.com>
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 03:06:29 +08:00
gensokyo-dev ba49f89666 fix(environment): bound discovery and cancel listener startup 2026-10-19 18:38:55 +00:00
Edgar ArakelyanandClaude Opus 5.5 b9382ce324 fix(ci): pull the agentenv lane's base images from mirror.gcr.io
Public ECR caps anonymous pulls by data per source IP, and hosted
runners share IPs, so the lane failed on every run today while the
pinned framework built its service-db image from
public.ecr.aws/docker/library/postgres. The lane now switches Docker to
the containerd image store, pulls each public ECR base image the pinned
framework's Dockerfiles name from mirror.gcr.io (the same Docker
official images under the same digests) and names it as the Dockerfile
does, as the framework's own CI does. The verifier's quota handling
still covers anything pulled from public ECR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:37:57 -07:00
gensokyo-devandKaoru0822 e84e17e30f fix(rizin): accept proven inferior exit after detach (#5281)
Reuse the common Linux identity reader and retain the original PID/start-time pair throughout detach. After Rizin confirms no active descriptor, accept a proven end of that original process while preserving refusals for unresolved or live mismatched targets. Remove the duplicate proc parser and cover deterministic exit/live-redirect transitions with owned fixtures.

Fixes #5277

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-20 02:29:04 +08:00
gensokyo-dev 8c46c5b08b docs(environment): clarify bounded argument and RPC identities 2026-10-19 18:04:37 +00:00
gensokyo-dev 1c2c2f1e78 fix(process): settle native exit and repair ownership verification (#5249)
* fix(process): classify baseline cleanup with current ownership facts

Use the pre-launch baseline only to select candidates for current native
identity/token validation. Preserve confirmed absence and verified foreign
generations instead of carrying a premature baseline identity failure.

Exercise the real Linux enumeration/exit race and retain countercontrols for
unknown identities and live token-owned processes.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* fix(ci): distinguish process inventory from historical PID lookups

* test(ci): verify decoded historical PID controls before tracing

* fix(ci): trace historical PID handles and signal probes

* fix(ci): resolve traced directory paths across pathname syscalls

Classify producer-decoded FD/path pairs once instead of limiting failed relative
lookup detection to openat on /proc. This preserves attempted readlinkat, statx
and newfstatat accesses with no returned descriptor.

Three regression cases fail against the previous policy and all 33 controls
pass with the shared pathname interpretation.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* test(ci): declare unresolved legacy pathname coverage

Report the historical-PID access surfaces actually checked and explicitly mark
legacy cwd-relative pathname calls unverified. The existing tracer does not
provide their cwd identity, and a blanket rejection also rejects legitimate
GDB build-ID metadata queries.

Retain every committed access guard and document the preexisting limit without
claiming absence from missing path evidence. The complete real 44-case CLI/MCP
recorded-crash qualification passes with the coverage declaration.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* fix(ci): reject priority access to historical PIDs

* fix(ci): preserve C-quoted components in traced path checks

strace renders non-ASCII pathname bytes as C octal escapes, not JSON strings.
Keep those components opaque when resolving literal ASCII path separators and
proc PID selectors, matching the existing absolute-path interpretation.

Two controls fail before the correction and all 35 pass afterward. An actual
strace observation independently reproduces the rejection of an unrelated
Chinese filename and verifies the corrected classification.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* fix(ci): reject historical PID resource and scheduler calls

* fix(schema): preserve portable large base64 validation

* fix(ci): share explicit PID syscall contracts with tracing

Derive tracer selection and reported coverage from the same named target
contracts used by the access checker. Cover resource limits, scheduler calls,
process metadata, PID groups, capabilities and pidfd operations without mixing
UIDs, policy enums, self selectors or output values with target PIDs.

Interpret each target once and retain unresolved target facts as a distinct
failure. Emit the coverage catalog once per verifier result.

The previous oracle misses 28 new controls. All 83 controls pass after the
change; real native resource/scheduler probes capture 14 previously missed
calls with resource limits and affinity unchanged. All 35 selected syscall
names are accepted by the pinned local strace.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* fix(ci): classify I/O priority and qualify PID trace coverage

* fix(process): keep ownership retries on the native clock

* fix(ci): retain process edges in ownership trace inventory

Keep fork/vfork and resumed edges along with clone events so the shared attribution owner receives the complete process relation facts it consumes.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)

* fix(process): type native exit predicates and ownership fixtures precisely

* fix(ci): retain trace coverage limits after integration

Restore explicit unverified symlink aliases and same-Node stat/status purpose in the shared coverage contract and guide. The native-exit and trace-attribution integration does not establish those properties. Preserve both limitations rather than silently broadening the reported qualification.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
2026-10-20 02:01:00 +08:00
gensokyo-dev 0ab4bbde31 fix(environment): bound argument and replay metadata allocations 2026-10-19 17:56:30 +00:00
171da5591e fix(ci): record every agentenv run and retry only public ECR rate refusals
The receipt's agent_env_run is recorded in a finally block, so a failed
receipt says how the last run ended, how many runs there were and which
public ECR refusal ended it: public_ecr_quota is data_limit for the
per-IP data-transfer cap and rate for a request-rate refusal. Only a
rate refusal earns the one retry; the data cap fails the lane at once,
since a pause on the same runner cannot lift it.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:53:01 -07:00
gensokyo-dev 0133c48eff chore: update environment serve with latest main 2026-10-19 17:51:41 +00:00
gensokyo-dev 6a368d26da chore: reconcile author replay and metadata fixes
# Conflicts:
#	docs/agent-environments.md
#	docs/specs/agent-environments/environment-serve/spec.md
#	src/application/environment/environmentReplay.ts
#	src/application/environment/environmentTools.ts
#	src/cli/environmentCommands.ts
2026-10-19 17:51:41 +00:00
gensokyo-dev e9f1f13fd6 fix(environment): preserve replay numbers and cancel file loading 2026-10-19 17:51:03 +00:00
Edgar Arakelyan 150f9a5f2b chore: merge environment serve (b217929a) into environment export 2026-10-19 10:49:59 -07:00
NoThingandKaoru0822 1b3ac94242 fix(rizin): bound recent history frames by UTF-8 byte budget (#5246)
Bound recent decoded history to complete UTF-8 prefixes and reuse the bounded capture implementation without changing command Evidence or wire queue accounting. Add deterministic Unicode and invalid-byte coverage, and document history retention.

Fixes #5091
Fixes #5242

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-20 01:41:46 +08:00
Edgar ArakelyanandClaude Opus 5.5 b217929a81 fix(environment): alias long query names, bound reply line metadata, keep empty queries
A captured query name longer than 64 characters is advertised under a
short, collision-safe `query_<n>` alias, with the captured name sampled
in its description; replay maps the alias back, and the manifest keeps
the full name.

Replies cut `recorded_path` and `recorded_query` to 1 KiB and set
`recorded_line_truncated`, so a megabyte-scale recorded URL is not
echoed into every reply; selection still uses the full recorded line.

An explicit empty query (`/api?`) keeps its `?` in `recorded_query`. The
shared WHATWG URL parser reports it as "", like no query, so the replay
exchange reads the delimiter from the recorded URL instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:26:07 -07:00
gensokyo-devandKaoru0822 2dd5effe2a fix(rizin): default one-shot output to plain presentation (#5269)
Default native one-shot Rizin presentation to plain text before collection while preserving caller colour overrides, literal output, recorded argv and shared CLI/MCP Evidence.

Fixes #4488

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-20 01:12:35 +08:00
Edgar ArakelyanandClaude Opus 5.5 130bc4326a fix(environment): keep exact JSON numbers, stop startup on shutdown, bound described paths
Replay parses a JSON body only when every integer survives exactly; a
body with an integer outside JavaScript's safe range, such as an id of
9007199254740993, is returned as its recorded text instead of with
other digits.

A SIGINT or SIGTERM that arrives while environment-serve reads and
authenticates its files now ends startup with a cancelled result before
the listener binds, rather than binding and stopping at once.

A tool description cuts a captured path longer than 1 KiB at a
character boundary and points to the manifest Evidence, matching the
list sample budget; the manifest keeps the full path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 10:06:59 -07:00
gensokyo-dev ad52275d22 chore: retain latest author input and shutdown fixes 2026-10-19 16:40:32 +00:00
c4aaf813e0 fix(javascript): retain selected application paths in Evidence
Record the admitted selected path separately from canonical artifact identity in successful and partial Evidence. Anchor relative inputs consistently across both CLI routes using the existing caller-path owner.

Adapt shared client verifier assertions and boundary coverage from PR #5261, and the dedicated-route anchoring correction proposed in PR #5265. Historical parsing remains independent of live paths, including legacy records without the parameter.

Validation: 118 focused tests in eight files, static and docs checks, discovery, and installed Gemini CLI 0.29.5 loopback verification of 207 schemas/241 examples passed. Synthetic static-analysis fixtures; no live Google API or native target execution.

Fixes #5258

Co-authored-by: kwakhyun <khyun2348@naver.com>
Co-authored-by: vishal-tambi <tambivishal3@gmail.com>
2026-10-20 00:37:45 +08:00
Edgar ArakelyanandClaude Opus 5.5 05ff5ce06a fix(environment): refuse capture Evidence that is not a HAR
The environment-manifest view projects HAR captures only, and replay
reads HAR's response fields, but the loader accepted any web network
capture format. A hand-paired SAZ, mitmproxy or qlog capture would load
and replay empty bodies; it is now refused as invalid input naming the
format, before the pair is checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:34:16 -07:00
gensokyo-dev afcd29d29f chore: sync replay follow-ups with author and latest main 2026-10-19 16:33:41 +00:00
gensokyo-dev 167c6aeb2f fix(environment): bound and mark replay discovery metadata
Sample captured observations, request-body keys and record ordinals before joining them. Preserve complete manifest facts and replay selection, and show omission counts with their Evidence source. Share the capture trust notice across standalone cards, tool discovery and MCP initialization.
2026-10-19 16:33:01 +00:00
Edgar ArakelyanandClaude Opus 5.5 7510c1a3c8 fix(environment): bound observed values in parameter descriptions
A parameter description lists at most ten observed values, each cut at
64 characters, followed by a count of the rest. tools/list and the
environment card are served whole, so a capture with many or very long
path values no longer inflates them; the manifest keeps every value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 09:23:30 -07:00
Edgar Arakelyan 5f3077bec1 chore: merge main (aacf740a) into environment serve after the streamable HTTP merge 2026-10-19 09:21:02 -07:00
gensokyo-dev ff970762ff chore: sync environment serve with latest main 2026-10-19 16:00:03 +00:00
Edgar Arakelyanandgensokyo-dev 60bd646478 feat(mcp): add opt-in streamable HTTP transport (#4955)
Add an explicit Streamable HTTP entry for environment/gateway hosts while keeping stdio registrations and default behavior. Preserve the shared provider/session owner across DELETE and replacement; fence and drain tool/completion work before handover or teardown.

Bound HTTP input and plain-response admission, cancel refused bodies, join whole exchanges and asynchronous response cleanup before provider hooks, gate startup readiness, and reject queued HTTP/1.1 pipelining while retaining sequential keep-alive.

Validation: 8 static/build tasks, 83 adapter tests and registry metadata pass. A real installed gh binary produces seven equivalent CLI/stdio/HTTP reports with DELETE/replacement and clean signal shutdown. Broader local native-provider/ownership failures reproduce on clean main and are documented with limitations in the PR.

Co-authored-by: Edgar Arakelyan <edgar.arakelyan@scale.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-19 23:58:51 +08:00
Edgar ArakelyanandClaude Opus 5.5 23b80c24a6 fix(environment): write exported capture copies readable by their owner only
The bundle's manifest.json and evidence.json are copies of captured
content, which can include values an application returned such as
session tokens. They are now written with mode 0600 regardless of the
caller's umask. The Dockerfile already copies them with --chown for the
runtime user, so the served environment can still read them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:55:26 -07:00
Edgar Arakelyan ede425e9d5 chore: merge environment serve (5e242c13) into environment export 2026-10-19 08:53:19 -07:00
Edgar ArakelyanandClaude Opus 5.5 5e242c1359 fix(environment): prefer verbatim path matches and validate data-plane messages
Replay ranks a record whose path segment equals the argument as written
above one that matches only after percent-decoding, so two recorded
spellings that decode alike no longer resolve by manifest order.

The /agentenv data plane answers -32600 for an id that is not a string,
number or null and for params that are not an object or array, and
refuses a batch of more than 100 messages before building any reply.

The environment MCP server now extends RequestTrackingMcpServer, which
the HTTP owner requires since the streamable-HTTP change it builds on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 08:53:11 -07:00
Edgar Arakelyan 2a6552fb14 chore: merge MCP streamable HTTP (ba73ccaf) into environment serve 2026-10-19 08:47:59 -07:00
morluto 255d906e15 fix(native): scan byte-pattern inputs without regexp stack growth
Keep exact wildcard, whitespace and aligned-mask validation in the shared
domain refinement. Advertise descriptive string inputs instead of repeating
regexes, and remove discarded byte/mask array materialization.

Preserve caller spelling and error precedence; cover large public stdio
queries, provider-boundary parsing and connection recovery.

Fixes #5257
2026-10-19 22:09:42 +08:00
gensokyo-dev ba73ccafd3 fix(mcp): classify HTTP binds from native address facts
Classify loopback from the actual bound IP only, then add the configured name to the Host/Origin allowlist. Remove DNS-name classification and the default/fallback that substituted configuration for binding evidence.

Validate the TCP address once before URL/allowlist consumers, preserve IPv4 and IPv6 alias behavior, and add negative controls for localhost names bound to non-loopback IPv4 and IPv6 addresses.
2026-10-19 14:05:23 +00:00
gensokyo-dev 4c09146b64 fix(mcp): cancel response sources across all write failures
Make the web-response writer own one reader and one cancellation operation across headers, pumping and completion, so every output exception retains source cleanup before provider teardown. The pump borrows that ownership instead of releasing the source on its own.

Reject raw fragment delimiters before parsing origin-form request targets, preserving percent-encoded query data. Add real HTTP negative controls for malformed chunks, invalid output headers and query fragments.
2026-10-19 13:39:40 +00:00
gensokyo-dev ed85af725d fix(mcp): retain HTTP response cleanup and reject pipelining
Own complete node HTTP exchanges and separately join response-source cancellation before provider hooks. Retain plain-response admission through asynchronous cleanup, preserve prompt HEAD delivery and MCP SSE admission, and fail closed on unsuccessful cleanup.

Reject queued pipelined requests before allocating work or buffered refusals, keep sequential keep-alive, and withhold all routes until server construction succeeds. Add real HTTP regressions for cancellation, late responses, tee ownership, cleanup failures, resource capacity, pipelining and keep-alive.
2026-10-19 13:13:13 +00:00
gensokyo-dev 5b14d4cea0 chore: refresh HTTP follow-up with latest main 2026-10-19 12:47:20 +00:00
gensokyo-devandKaoru0822 3ea0d9489e feat(objdump): select native disassembly by symbol (#5171)
Push optional native symbol selection into GNU objdump before collecting Evidence. Preserve native matching, raw output, artifact identity, scoped limitations and the existing full-disassembly default through the shared CLI/MCP workflow.

Fixes #5159

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-19 20:15:20 +08:00
gensokyo-dev 3eb0722ef2 fix(mcp): join HTTP route cleanup before provider teardown
Track admitted route dispatches until their finalizers settle, retain admission while uploads remain unfinished, and separate MCP cancellation from provider hooks. Reuse staged transport cleanup for startup failures and normal shutdown. Cover plain-route cleanup, incomplete streaming uploads and pending-factory failure with real HTTP requests.
2026-10-19 12:08:41 +00:00
morluto 49e67aa1d9 fix(process): retain native ownership evidence through cleanup
Keep a run-scoped evidence owner from acquisition through settlement and
cleanup retry. Bind token observations to native generations and retain
related generations and unresolved identity lookups across table omissions,
reparenting and process-group changes without treating PID hints as authority.

Use native effective UID facts for withholding decisions, corroborate Linux
procfs absence, and share the Linux stat parser with sampling and debugger
identity checks. Signal only after current token and group revalidation.
Complete swept cleanup across all groups with one bounded final family check;
retain unresolved owners and successful-peer completion across retries.

Validation: npm run check, docs:check and test discovery passed. Focused
ownership/consumer coverage totals 513 passed and 1 skipped across 35 files,
including the corrected Electron cancellation test rerun independently. Darwin helper compilation, real
owned Node child cleanup, CLI/MCP capture and retained cleanup retries ran.
Real Electron applications, native Linux races/PID reuse and Windows cleanup
were not qualified. The original Linux reports remain open for that work.

Fixes #5238
Refs #4322, #5206
2026-10-19 20:04:00 +08:00
gensokyo-dev 0fc8462be1 fix(tests): complete independent agent evaluation cleanup
Attempt independent auth and run-tree cleanup even after permission denial,
retaining the primary verification failure alongside cleanup errors. Exercise
both retention modes through the verifier entrypoint, preserve startup
diagnostics, and retain cooperative coverage for root.

Fixes #5095

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
2026-10-19 11:54:04 +00:00
gensokyo-dev 0d423442cc chore: refresh HTTP follow-up with current main 2026-10-19 11:49:40 +00:00
gensokyo-dev 94a0e994f0 fix(mcp): bound HTTP ingress and release refused bodies
Admit a bounded number of HTTP input dispatches before constructing requests or initialize tees. Release permits after dispatch and cancel each body forwarder when SDK processing ends. Preserve HTTP reply ownership by pausing cancelled incoming bodies and retaining native stream completion monitoring. Cover overload recovery, early SDK refusals and real unfinished uploads.
2026-10-19 11:33:05 +00:00
gensokyo-dev b999e72476 fix(ci): repair capture ownership and portable ABI validation (#5224)
* fix(tests): restore reliable snapshot and container CI checks

Keep exact cancellation causes and partial snapshot facts in regression oracles. Match fault injection to real directory handles and isolated MCP module ownership; await terminal cleanup progress within the existing test deadline. Reuse the valid ASAR Pickle fixture and preserve truncated-container rejection.

* fix(tests): isolate runtime faults and own CLI subprocesses

Keep the runtime provider mock in the isolated project after reused CLI graphs exposed lost fault injection. Use the existing owned CLI fixture for Inspector parity and update command checks, retain caller environment choices, and require the removed alias to fail with COMMAND_NOT_FOUND. Keep current test deadlines and production behavior.

* fix(process): retain executable handles through read cancellation

Use the existing borrowed descriptor reader so stream cancellation cannot invalidate a handle owned by capture. Preserve the exact cancellation and permit immediate scope reuse after cleanup. Reproduce the native-stream failure with actual file IO and retain completed/failed-close controls.

Synchronize runtime cancellation and backwards-clock injection with observed running progress. The corrected clock oracle now rejects a Date.now-based deadline under controlled rollback; keep test deadlines and narrow host cleanup checks unchanged.

* test(process): observe prelaunch cancellation at descriptor reads

* fix(process): retain read failures alongside observed cancellation

* fix(flutter): advertise portable Unicode ABI selectors
2026-10-19 19:32:22 +08:00
gensokyo-dev d82c73932a chore: refresh HTTP follow-up with latest main 2026-10-19 11:28:37 +00:00
gensokyo-dev 63b7e82f31 fix(mcp): fence HTTP dispatch before draining sessions
Own HTTP request parsing and dispatch before SDK awaits. Fence closed-session messages, abort pending body reads and cancel stale response streams before releasing shared resources. DELETE remains outside its own drain. Cover late bodies and sampled public SDK dispatch orderings while preserving stdio behavior.
2026-10-19 11:02:46 +00:00
gensokyo-dev 7fbbfb7433 chore: refresh HTTP follow-up with current main 2026-10-19 10:46:50 +00:00