Commit Graph
3388 Commits
Author SHA1 Message Date
Dery Ferdikaandgensokyo-dev 98ec00f406 fix(setup): preserve cleanup ownership and resource reports (#6920)
* fix(setup): report host-owned cleanup resources alongside the primary's

SetupHost.close documents that it reports the resources a setup host still
owns, but its contract returned only a string. runSetup therefore built the
ProviderCleanupError from the primary failure's cleanupResources alone, so a
resource the host failed to release reached the projection only inside a
free-text reason while the error asks the caller to review the reported local
resources.

Return a SetupCloseReport instead. closeSetupResources absorbs the structured
resources of any cause that reports them, through
ArtifactReaderFailure.cleanupObservation, and leaves opaque failures
message-only so no resource name is invented. runSetup then unions the host's
resources with the primary's before building the typed cleanup error.

Two boundary tests read the close result directly: the skill-cleanup case now
asserts the retained backup path in the report reason rather than in a bare
string, and the shared ownership helper takes an opaque close result because it
only ever awaits undefined from either host it is given.

Validation: RED then green in src/application/Setup.recovery.test.ts, where
the new case previously received only the primary resource; 116 tests across
the seven Setup and cleanup-ownership suites pass; tsc --noEmit over the
changed set, its setup callers, and both boundary tests exits 0; oxlint
reports 0 errors; oxfmt --check is clean; verify:module-boundaries passes.
The two failures in src/setupEnvironment.test.ts reproduce identically on
pristine bded9c628 with this change stashed.

* fix(setup): preserve cleanup ownership through host reports

* fix(setup): bind finalization reports to cleanup owners

* fix(setup): retain live resources in returned cleanup views

* fix(setup): preserve completed cleanup and exact installer resources

* fix(setup): retain delegated cleanup across authority changes

* fix(setup): compose callback and source cleanup authorities

* fix(setup): retain producer cleanup failure reasons

* fix(cli): render structured setup cleanup resources

* fix(setup): separate failure evidence from cleanup ownership

* fix(setup): normalize close failures and unify lease binding

* fix(setup): preserve direct lease resource attribution

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-24 15:08:10 +08:00
morluto bdf15b9bd5 refactor(javascript): share the reconstruction input contract
Remove the reconstruction-only request schema and consume the canonical parsed
JavaScript application input. Production already owns parsing at the service
boundary; direct test seams now use that same schema instead of a weaker path
contract. Preserve format, filesystem, source selection and lifecycle validation.

Add a NUL-path regression for canonical admission and typed input-error
projection. Verified 63 focused cases plus static, build, docs, discovery and
duplication checks; no target execution or real-provider claims.
2026-10-24 15:02:26 +08:00
morluto d68d03e88f test(mcp): consolidate fixture connection and cleanup ownership
Route application and provider-environment harnesses through the shared MCP
connection owner. Join accepted handshakes during shutdown, retain each failed
close for retry, preserve primary and independent cleanup failures, and release
provider files only after their session closes.

Surface BinarySession close Result errors in production and artifact fixture
teardown. Add real SDK and descriptor-boundary regressions for startup races,
concurrent cleanup, mixed failures and recovery. Use a provider-free plist for
descriptor ownership so installed deep engines cannot change the test outcome.
2026-10-24 14:49:13 +08:00
gensokyo-dev d87e73f2db test(javascript): execute the registered Webpack export fixture (#6951) 2026-10-24 05:27:20 +00:00
Kaoru0822andClaude Opus 5.5 b869fa762a test: align stale fixtures with recent native and launcher contracts (#6945)
* test(native): expect artifact_changed when a bound metadata target is lost

41e10b240 made a bound metadata target that fails the source boundary
(`path`) or disappears (`ENOENT`) report AnalysisArtifactChangedError, as
its comment and docs/testing.md state, but left the module test expecting
AnalysisInputError. The test now asserts the shipped contract, so main's
Test shard and Portable tests lanes pass again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(package): ship the CLI process environment owner in launcher fixtures

c2caae88f moved launcher environment preparation into
scripts/lib/cli-process-environment.mjs, made scripts/rea.mjs import it and
made verifyPackagePack require it in the packed listing, and updated the
dispatcher fixtures, but two other fixtures still omit it:

- packageTarListing's fake tar listing, so every case stops at "package
  omitted the CLI process environment owner" before its own assertion;
- deferredRuntime's copied compiled package, so the copied launcher fails
  to resolve its import instead of reporting the corrupted catalog.

Both fixtures now include the module, as the package ships it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(native): expect XML plist validation in typed-value provenance

9f5dd56e2 records a successful `plutil -lint` of an XML plist source in
provenance, as docs/native-investigation.md states, but the macOS typed-value
CLI test still expected only the `file` step for both formats. XML sources now
expect the lint step; binary sources are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:08:18 +00:00
morluto 21a20306b4 test(sqlite): preserve worker failures through cleanup retry 2026-10-24 12:34:10 +08:00
morluto f774dc420b fix(javascript): bind factory export roles to parameter values 2026-10-24 12:34:10 +08:00
e5965adb29 feat(cli): accept JavaScript source selections from a JSON array or file (#5029)
* feat(cli): accept JavaScript source selections from a JSON array or file

Add --source-paths-json to analyze and analyze-javascript-application.
It takes an inline JSON array or a JSON file path of exact inventoried
paths and appends them after any --source-path values, so a long
selection no longer has to fit on one command line (cmd.exe through npx
on Windows stops at 8,191 characters). Entries stay artifact-relative and
go through the existing source_paths validation; the native lane rejects
the option like --source-path.

Refs #4987

* fix(cli): cancel --source-paths-json file reads with the command

Pass the command's abort signal through parseCliJsonInput to
readJsonInputFile, so SIGINT/SIGTERM stop a selection-file read instead
of waiting for it to finish. A cancelled read now propagates its abort
rather than being reported as a file read failure.

* test(cli): preserve ASAR identity for JSON file selections

* docs(cli): record source-selection task costs and identity verification

---------

Co-authored-by: KJLavender <KJLavender@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-24 12:32:41 +08:00
morluto 60242ec82d test(cli): retain process outcomes across workflow assertions 2026-10-24 12:30:37 +08:00
morluto 1d896e03b7 fix(artifacts): retain original I/O failure evidence 2026-10-24 12:21:44 +08:00
morluto 915e56e3e5 fix(setup): preserve launcher identity during registration repair 2026-10-24 12:11:54 +08:00
morluto 850abe5e6f refactor(managed): remove obsolete throwing domain facades 2026-10-24 12:11:54 +08:00
morluto ddfd060210 test(artifacts): verify ZIP cancellation through extraction rollback 2026-10-24 12:07:33 +08:00
morluto aa9043f6b6 fix(native): preserve qualified Swift protocol identities 2026-10-24 12:07:33 +08:00
morluto 6843dbea9b fix(native): preserve bounded JVM identity before FAT admission 2026-10-24 12:07:33 +08:00
morluto 21097b192b fix(javascript): preserve catch destructuring alias ownership 2026-10-24 12:07:33 +08:00
gensokyo-dev f9fabdfcb2 test(cli): time Kuna cleanup from producer readiness (#6944) 2026-10-24 04:03:26 +00:00
gensokyo-dev ead9fdcda9 feat(erlang): query selected BEAM table facts (#6943)
* feat(erlang): query selected BEAM table facts

* docs(perf): record BEAM selected-view measurements
2026-10-24 12:00:18 +08:00
morluto c2caae88f8 refactor(cli): share process environment preparation
Give the launcher and shared command worker one lightweight owner for package-version binding, Windows empty-home handling and Android browser-cache defaults. Preserve per-command preparation and environment restoration, package the owner explicitly, and retain its package and JavaScript recovery CI scopes.

Validation: dispatcher/version/shared-session, home fallback, evaluator/MCP/process cleanup and CI scope tests passed. Functional archive/install/repack, installed static CLI analysis and MCP checks passed; no real Codex/model trial or Windows/Termux runtime qualification was performed.
2026-10-24 11:50:11 +08:00
morluto 3ad465a666 refactor(evaluation): move agent grading into development ownership
Keep the maintained manual evaluator, fixture rubrics and semantic tests together under tests/evaluation/model-evals instead of shipping them in dist. Load the same typed owners from the manual runner and update the architecture and client guide. Grading/report contracts and executable logic are unchanged.
2026-10-24 11:50:11 +08:00
4ef916da03 feat(pe): inspect import and delay-load tables (#6509)
* feat(pe): inspect import and delay-load tables

Add inspect_pe_imports / inspect-pe-imports to read PE32/PE32+ import
and delay-load directories without executing the image. The report keeps
DLL names, named and ordinal functions, ILT/IAT RVAs, and a pefile
import hash of the standard import table. A missing directory is
observed absence, not proof the image never imported APIs.

* fix(pe): default PE import fixture options

Allow peImportImage() without an argument so CLI and filesystem tests
can use the KERNEL32 sample without repeating an empty options object.

* test(pe): keep import path cases on the dedicated MCP contract

inspect_pe_imports already rejects relative MCP paths in its own
boundary test. Leave the shared absolute-path matrix to tools whose
handler issue projection matches that suite's expected shape.

* fix(native): index virtual-to-file mapping lookups

mappedFileOffset scans every mapping twice per span, so a parser that
translates one span per table entry costs sections x entries. Add
fileMappingLookup, which builds an O(n log n) interval index once and
answers each span in O(log n) with the same accept, reject and
translation results. A differential test checks it against
mappedFileOffset over randomized overlapping mappings and zero fills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra7LM2NyQ7DumdssxbUq5g

* fix(pe): report partial import evidence and exact pefile hashes

- Withhold imphash with an explicit reason whenever the standard import
  table is partial (unreadable names or thunks, missing tables), or when
  pefile 2024.8.26 would hash a different row sequence: invalid or
  truncated names, ordinal 0, descriptors without functions, tables its
  bounds or repeat/spread heuristics discard, and its 8192-thunk import
  symbol cap. Delay-load issues do not withhold it.
- Hash ordinal imports with pefile's complete ordlookup tables and its
  ord<decimal> fallback instead of declining unmapped ordinals.
- Report a nonterminal descriptor whose FirstThunk is zero, and a
  delay-load descriptor whose IAT or INT RVA is zero, as malformed_entry
  partial coverage instead of a complete empty inventory.
- Directory evidence lists the file spans actually consumed for the
  descriptor array and terminator; discontiguous mappings produce
  separate spans and separate Evidence ranges.
- Carry exhausted limits as PeImportLimitFailure.limit and derive
  recovery from it; the fixed 16 MiB retained-text ceiling reports a
  fixed allowance instead of max_file_bytes advice.
- Translate RVAs through the indexed mapping lookup and yield with a
  cancellation check every 1024 table entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra7LM2NyQ7DumdssxbUq5g

* fix(pe): read only own ordinal tables for DLL names

DLL names such as constructor and __proto__ pass pefile's name rule but
resolved inherited object members, throwing before the ord<n> fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ra7LM2NyQ7DumdssxbUq5g

* fix(native): preserve PE import facts and prove hash compatibility

* test(native): verify PE import workflows and measured costs

* refactor(native): narrow PE facts across the container union

* docs(native): record integrated PE import validation

* fix(native): bound every PE import RVA span

* docs(native): measure RVA guard completed workflows

* fix(pe): reconcile import coverage with retained rows

* fix(pe): retain partial imports at descriptor mapping gaps

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-10-24 11:44:12 +08:00
morluto f2eb27206f refactor(release): remove obsolete tag CLI and proposal output 2026-10-24 11:41:34 +08:00
morluto ae24b7879c refactor(native): consolidate command operation admission 2026-10-24 11:35:19 +08:00
morluto dd198d037f test(native): distinguish plist validation from conversion 2026-10-24 11:35:19 +08:00
morluto 8736fe3226 fix(release): avoid unused root commit file lookups 2026-10-24 11:35:19 +08:00
morluto 0f411508c3 fix(environment): decouple capture chronology from clock formats
Use exact recorded start facts for state extraction independently of derived clock formatting limits. Preserve millisecond interval policy, missing-time fallback, redacted-write cutoffs, and bounded timestamp retention; remove the superseded clock comparator.

Two source and two compiled CLI regressions reproduced post-write values being selected as initial state. State/clock/date, CLI/MCP view, and static checks passed after the fix.
2026-10-24 11:31:39 +08:00
morluto fbe77dc479 refactor(verification): separate readiness evidence scopes
Move the synthetic evaluator and its unchanged semantic tests out of the shipped runtime. Retain actual CLI and MCP Evidence separately from the synthetic nine-stage baseline in a versioned verifier artifact, execute its reported conformance checks, and assign the verifier to its CI lane.

Validation: evaluator/state/classifier source suites, compiled CLI/MCP views, verify:readiness, static checks, build and docs passed. Readiness observed coverage is static analysis; fixture runtime behavior and reconstruction closure were not executed.
2026-10-24 11:31:39 +08:00
morluto ba6cec31f5 fix(native): preserve plist admission through finalization 2026-10-24 11:27:27 +08:00
morluto 1564fc8d9b fix(managed): retain completed facts through close cancellation 2026-10-24 11:27:27 +08:00
morluto 41e10b240c fix(filesystem): distinguish admission and bound-target failures 2026-10-24 11:27:27 +08:00
gensokyo-dev d662fa54a6 fix(test): reserve heap headroom for shared CLI workers (#6941) 2026-10-24 03:23:25 +00:00
morluto 008931a178 refactor(hopper): move verifier assertions out of runtime 2026-10-24 11:19:45 +08:00
morluto cd10ee1f8a refactor(macho): centralize FAT declaration facts 2026-10-24 11:09:17 +08:00
morluto 80b7bbc8bd fix(environment): share exact recorded timestamp interpretation 2026-10-24 11:09:17 +08:00
morluto f3269feaad test(mobile): preserve encrypted bundle path facts across adapters 2026-10-24 11:02:45 +08:00
morluto cad14f3b35 test(javascript): cover primitive spread changes through CLI and MCP 2026-10-24 11:02:45 +08:00
morluto 7f70797b98 test(native): align plist fixtures with selected source validation 2026-10-24 10:57:37 +08:00
morluto 9f5dd56e2f fix(native): validate XML plist source admission 2026-10-24 10:56:25 +08:00
morluto 2bd981b017 refactor(tests): consolidate compiled CLI session ownership 2026-10-24 10:50:03 +08:00
morluto 6021efd371 refactor(browser): move bundle fixture composition out of runtime 2026-10-24 10:49:46 +08:00
morluto 7958e15892 fix(pcap): preserve header snapshot limit with inferred lengths 2026-10-24 10:35:50 +08:00
morluto e09b06369d refactor(cli): remove redundant alias coverage metadata
Remove the duplicate command-alias enumeration and convention-equivalent tool mappings. Keep explicit semantic exceptions, independent MCP-only policy and exact runtime alias-target coverage.
2026-10-24 10:30:05 +08:00
morluto bd1b2c74ae fix(browser): resolve companions from the selected manifest directory
Resolve the filesystem-selected manifest parent once before deriving script paths and reuse the shared containment rule. Preserve selected manifest spelling and capture metadata while retaining source integrity, symlink refusal and cleanup. Cover differing and identical lexical siblings through both artifact consumers and public CLI/MCP parity.
2026-10-24 10:30:05 +08:00
gensokyo-dev e2463372ea feat(python): query selected pyc code-object facts (#6928)
* feat(python): query retained pyc code-object facts

* test(python): bind complete pyc selection benchmark tasks

* test(python): include server instructions in token accounting

* docs(perf): record pyc selected-facts task measurements

* test(python): keep oracle dependencies separate from selected targets

* docs(perf): record guarded oracle requalification

* test(python): narrow complete Evidence through its owning contract
2026-10-24 10:23:06 +08:00
morluto 315b23403f perf(cli): prepare positional token schemas only for the selected command 2026-10-24 10:20:36 +08:00
morluto cc18e9ad0d fix(native): decode plist sources within result capacity
Derive ordinary plist depth from existing JSON result capacity while preserving archive limits. Decode supported XML and safe JSON directly from owned source bytes; retain conversion for OpenStep, unsafe numeric classification and unsupported encodings. Preserve typed scalar facts, truthful provenance, cleanup ownership and explicit capacity recovery.
2026-10-24 10:17:23 +08:00
morluto 2f2b07f750 fix(environment): count scenario bodies after request admission
Move body-retention coverage accounting to the manifest request-line owner. Preserve source retention facts by ordinal and remove the competing eligibility rule from scenario projection.
2026-10-24 10:17:23 +08:00
morluto 37f24125ad fix(javascript): resolve proven URL constructor aliases
Remove the redundant spelling gate after the shared intrinsic owner proves native constructor and source-base identity. Retain local-constructor and replaced-export uncertainty through public application analysis.
2026-10-24 10:17:23 +08:00
morluto 263a98c6ce fix(managed): preserve malformed signature uncertainty in comparisons
Consume the signature producer status before inferring operand-resolution limits. Preserve exact byte-match provenance while malformed paired signatures remain unknown through current and historical Evidence, CLI and MCP.
2026-10-24 10:17:23 +08:00
morluto 6298c84eea refactor(javascript): consolidate semantic graph boundaries
Retire the unused graph serialization facade and use one typed query implementation after canonical request admission. Migrate tests to the owning schemas while preserving graph commitments, Unicode transport, provenance, uncertainty, traversal and reconstruction controls.
2026-10-24 10:13:24 +08:00