* feat(ghidra): set function signatures and define the types they use
annotate_native_function accepts an optional C prototype, applied with
USER_DEFINED source in the same transaction as the name and comments,
verified by readback and rolled back with them on refusal.
define_native_data_types stores caller-authored struct, union, enum and
typedef definitions atomically under /rea_caller_defined and refuses
existing names. inspect_native_data_type reports those types with source
caller-defined, and annotation readback reports the applied prototype
and its source.
Refs #14831
* feat(ghidra): bound caller C text with launch controls and refuse unapplied constructs
The lengths of a signature and of type declarations and the nesting depth
of parentheses are launch-only REA_ controls with measured defaults, floors
and maxima, written into the bridge's session descriptor. A refusal names
the control, its effective value, source and range.
The bridge tokenizes caller C before Ghidra's parser sees it and refuses
what that parser accepts without applying: attributes, storage-class
specifiers, variable declarations, directives other than #pragma pack,
literals, function bodies, default arguments, unnamed enums and repeated
member names. A type name that names different types is refused.
When a function has no calling convention and the prototype names none,
the compiler specification's default convention, which Ghidra already uses
to assign the locked storage, is recorded, and annotation readback reports
the convention.
Refs #14831
* fix(ghidra): apply the signature bound to the caller's text
The bridge appended the semicolon its parser needs before checking the
length, so a prototype of exactly the admitted length was refused. The
readback prototype is documented as reusable only when its function and
type names are C identifiers.
Refs #14831
* chore(mcp): refresh advertised schema summaries for Ghidra type edits
Refs #14831
* fix(ghidra): bound caller C text per call and report dropped qualifiers
Ghidra's C parser cannot be cancelled, so REA bounds the text it parses.
The three launch-only environment controls left an agent that hit them
with a restart as its only recovery. The two length bounds are now
per-call parameters, signature_max_utf16 on annotate_native_function and
declarations_max_utf16 on define_native_data_types, with the same defaults
and measured maxima. A refusal reports details.limit with
control_kind "parameter" and required_value, the text's length, so the
generated recovery names the value to pass or asks for shorter text. The
text fields no longer carry a schema maximum, so every over-length
refusal is typed. Parenthesis nesting is a fixed ceiling of 8 levels,
registered as a representation bound, because each level doubles parse
time. The session descriptor no longer carries C parser limits, and the
config module, environment entries and restart-only registry rows are
removed.
const and volatile are still applied without effect, because Ghidra's
types have no representation for them. Both edits now return
dropped_qualifiers with each qualifier's line and column, and for a
signature its parameter index, null for the return type, instead of
dropping them silently.
* fix(ghidra): read caller C through one tokenizer and bound nesting per call
The C admission scan tracked lines only at LF and read directives as raw
lines matched by a regular expression, so a CR-only line break shifted
dropped-qualifier positions and a trailing comment on #pragma pack was
refused. One tokenizer now owns caller C positions, comments and literals:
CR, LF and CRLF each end a line as in Ghidra's parser, and directives are
admitted from its tokens, so comments read as whitespace there too. A block
comment that would carry a directive onto another line is refused.
Parenthesis nesting was a fixed ceiling justified by parse time, a resource
limit. It is now the per-call parenthesis_max_depth (default 8, range
1..12) on both type-edit tools. The bridge measures the deepest nesting
over the whole text and sends it, with a text's length, as the wire
failure's required_value, so details.limit reports the bridge's own
measurement instead of the adapter re-reading the request.
The tokenizer also decides whether a prototype is terminated, so the parser
sees the caller's text unchanged: no leading whitespace is stripped, and a
trailing line comment no longer swallows the appended terminator.
* fix(ghidra): parse caller C inside the edit's rollback and refuse parser diagnostics
Ghidra's C parser writes the type database even with storeDataType false:
a definition whose name matches an existing empty composite fills that
type in place, in the parser's own nested transaction. Both type edits
parsed before opening their transaction, so a refused definition, such as
one conflicting with a DWARF placeholder, left that placeholder filled.
Parsing, validation and storage now share the edit's one transaction, and
parseCallerC refuses to run outside one.
The parser also records diagnostics it cannot apply, such as a repeated
enumerator it drops, and still reports success. Both edits now refuse any
diagnostic with Ghidra's message, before anything is stored.
The real-Ghidra verifier gains a phase with an ELF object whose DWARF
declares an opaque struct, proving a refused definition leaves that empty
composite unchanged, and refuses a repeated enumerator.
* fix(ghidra): admit caller C from one audited table of tokens Ghidra drops
Review kept finding one more construct Ghidra's C parser consumes without
applying, because admission listed spellings piecemeal. The tokenizer now
owns one table, audited against every token and production of Ghidra
12.2's C.jj and checked on Ghidra 12.2, in that grammar's own spellings:
- Refused, because meaning is lost: __ptr32 and __ptr64 (stored as a
native-width pointer), __near and __far, every attribute, declspec,
__readableTo, alignas, packed and asm spelling, [[...]] attributes,
storage and inline specifiers including __forceinline, __pragma and
_Pragma, _Static_assert, Objective-C @ blocks (Ghidra skips their whole
text), and backslashes.
- Reported in dropped_qualifiers as pure qualifiers: every const and
volatile spelling, restrict, __unaligned and __w64.
#pragma pack is admitted only in the operand forms Ghidra applies as
written with a decimal value; (0x1), (010), (show) and (pop, n) were
ignored or read differently, and "# pragma" is a line marker Ghidra
skips. An enum tag that neither the text nor the database defines made
Ghidra invent an empty enum without a diagnostic; declarations now refuse
it as they do an invented struct or union. Identifiers admit $, as C.jj's
do, and the tokenizer reads numbers and [[ as single tokens.
* fix(ghidra): bound caller type depth, admit only constant expressions Ghidra evaluates, refuse unmatched pack pops
Recursion: the tokenizer's [[ lookahead re-entered next() for each "[",
and the dependency walk recursed per pointer, array and member level.
Both are iterative now. Ghidra 12.2's own data-type code recurses too:
1024 pointer or array levels resolve, 2048 exhaust the stack inside
addDataType while its database lock is held, leaving the Program unable
to save. Every parsed type's chain through pointers, arrays, typedefs and
members, including existing database types, is now measured iteratively
and refused beyond a fixed 256-level ceiling before Ghidra walks it. An
unexpected StackOverflowError ends the session with a reason instead of
being caught by the parser call, since Ghidra's lock may then be held.
Constant expressions: Ghidra leaves names, casts, sizeof, floating and
binary literals unevaluated and substitutes a default, so
"MASK = FIRST << 4" was stored as 2, and it truncates values outside int.
Enum values, array sizes and bit-field widths are admitted only as integer
literals with arithmetic, shift, comparison, bitwise and logical
operators, checked iteratively with C's rules to stay in int, including
implicit enumerator values; anything else is refused at its position.
Pragma pack: Ghidra ignores a bare (push), a pop with nothing pushed keeps
the current packing, and a plain pop pops past labelled entries. The
tokenizer tracks admitted pushes and admits a pop only when Ghidra's
result matches C's.
* fix(ghidra): admit constant expressions only as one literal, skip absent pointer targets, state the type-depth recovery truthfully
Constant expressions: emulating C against Ghidra's own evaluator is an
open-ended class of mismatches (comparisons, unsigned arithmetic such as
~0U >> 1 giving -1, names, casts, truncation). The evaluator is removed.
Enum values, array sizes and bit-field widths are admitted only as one
decimal or hex integer literal within int, optionally negated, without
suffixes; anything else is refused at the first token that leaves that
form, and the refusal says to write the computed value. Implicit
enumerator values are still checked against int.
Dependency walk: Ghidra's generic pointer has a null pointed-to type, and
pushing it onto the ArrayDeque threw. Both the dependency and depth walks
now take children from one cTypeChildren and skip an absent child.
Type depth: the depth is measured over the whole chain before comparing it
with the limit, so the refusal reports the depth it used, and it names
the type from the parser's table rather than walking the type for a name.
The recovery no longer suggests splitting into named types, which cannot
help because depth counts through typedefs and existing types; it says
only fewer nested levels do.
* refactor(ghidra): refuse parentheses in definitions and keep parenthesis_max_depth on signatures only
Under the literal-only rule for constant expressions, every parenthesis in
a define_native_data_types text already ended in a refusal (function
declarators, attributes, casts, sizeof, or a Ghidra diagnostic for a
grouped declarator), so parenthesis_max_depth changed only which refusal
a caller saw. A definition now refuses its first parenthesis at its
position, and the parameter is removed from that tool's schema; it stays
on annotate_native_function, whose prototype has a parameter list.
* fix(ghidra): refuse distinct types that share one parser name
Ghidra keeps struct tags, enum tags and typedefs in separate maps.
Combining those maps dropped a typedef such as typedef int item when
struct item was also defined, and the call still succeeded. Overlapping
names are stored only when the definitions are equivalent, which keeps
typedef struct s { ... } s as one struct. Any other overlap is refused
with conflicting_type_definitions before the transaction stores anything.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(ghidra): roll back a composite the parser fills in place
Ghidra's parser replaces an empty composite during parsing and returns
that same object. A later same-path check would store the fill as
unchanged. Record those empty composites before parsing and refuse if
parsing fills one, so the open transaction restores them. A different
layout of a non-empty caller type still conflicts and leaves the stored
type in place.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(ghidra): close line comments at EOF and refuse overflowing pack values
Ghidra's // skip token requires a line break, so a comment at the end of
declarations or of an already-terminated signature was rejected. A newline
is appended whenever the text ends in a line comment, before any semicolon
added for an unterminated prototype.
Integer.parseInt drops a pack operand outside a Java int and leaves the
previous packing, so #pragma pack(2147483648) stored a natural layout.
Decimal pack operands are admitted only when that parse succeeds.
Co-authored-by: morluto <morluto@users.noreply.github.com>
* test(ghidra): assert the empty-composite refusal by code and readback
Defining a struct over the DWARF placeholder fills that empty composite
during parsing, so the refusal is data_type_conflict before the old
name-conflict message. The verifier checks that code and that the
placeholder still has no fields.
Co-authored-by: morluto <morluto@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
* fix(ghidra): reuse completed decompiles and decompile code outside functions
* perf(ghidra): decompile upcoming export functions in parallel
* fix(ghidra): say what the procedure inventory omits and how to reach it
* fix(ghidra): say when a file offset maps to code outside every function
A file-offset selector that mapped to disassembled code without a function
failed with advice to choose an inventory procedure, which cannot name that
code. The failure now states the fact and that procedure_pseudo_code can
decompile it by the mapped analysis address.
One predicate now decides that an address holds code outside every function
for the address, file-offset and procedure_not_found paths, and the bridge
imports UndefinedFunction and SoftReference like its other dependencies.
* fix(ghidra): scope decompile read-ahead to the operation it prepares
The bridge ran the read-ahead window in the generic serve loop, before the
ping, analysis-incomplete and read-only checks and for any method that
carried the field. It now runs only for procedure_pseudo_code, after those
checks. The pool state sits with the other decompiler fields and its Ghidra
types are imported.
The export tests now cover consecutive windows, a limit that ends inside a
window and a window whose first function sends no decompile request. The
provider guide states that a function failing or timing out inside a window
is attempted again by its own request, and how long the pool lives.
* fix(ghidra): decompile code outside functions selected by file offset
A file offset names the same location as its mapped analysis address, but
an offset that mapped to code Ghidra disassembled without a function was
refused while the address decompiled. The offset now resolves through the
same on-the-fly UndefinedFunction path and limitation, and its selection
reports the inferred entry as procedure_address. The refusal that sent the
caller back to the address form is removed.
* fix(ghidra): bound decompile read-ahead by the carrying request's deadline
A request that carried a read-ahead window waited for every function in it,
then decompiled its own function again when the window's attempt failed or
timed out, so one configured deadline could elapse twice. That request now
waits only within its own deadline, consumes the window's outcome for its
function whatever it is, and cancels siblings still running once it has its
result and the deadline has passed; they stay uncached for their own requests.
The hint is advisory, so selectors past one window are now ignored instead
of refusing the request. Pooled decompilers run on a private thread pool
rather than resizing Ghidra's shared "Parallel Decompiler" pool, and are
released after 30 seconds without a window.
* test(ghidra): cover read-ahead deadline and hint clamp on real Ghidra
The decompiler failure probe now injects a read-ahead window whose carrying
function times out beside a sibling that never finishes. It checks that the
request reports the timeout without decompiling again, waits only within its
deadline, leaves the cancelled sibling uncached, uses REA's own thread pool,
and that a longer hint is clamped to one window.
The probe no longer ran against the current bridge: it used a removed
three-argument Request constructor, expected the old timeout and failure
wording, and injected decompilers that completed-result reuse never called.
It now builds full requests, matches the current messages by prefix and
clears reused results before each injection.
* fix(ghidra): keep reused decompiles across reads without decompiler options
A request that omits decompile_max_payload_mib now leaves the session's
payload limit unchanged instead of resetting it to the Ghidra default,
so an instruction or metadata read no longer discards completed
decompiles. An explicit null still selects the installed default.
Boundary limitations for a reused decompile of code outside every
function now use the function the decompile widened, not a fresh
entry-only UndefinedFunction.
* docs(ghidra): state what an omitted decompiler payload option means
* fix(decompile-all): plan read-ahead from the decision the export loop makes
The read-ahead window decided which functions would be requested from
journal history alone. A journaled write whose file was later deleted
is requested again, and file problems spend the caller's limit, so a
resume could prepare functions outside its limit while the ones it
requested got no preparation.
Each function is now decided once by the same check the loop uses. The
window keeps those decisions for the loop, counts every attempt against
the limit, and names only functions that will be decompiled.
* test(ghidra): cover payload-option omission and reused undefined-function bodies
* fix(decompile-all): start each read-ahead hint at the function that sends it
A function the window named first could send no decompile request, for
example when procedure_info classifies it as external, so the next
request sent a hint headed by that function. A provider reads the head
as the carrying request's own function, so the bridge could not keep
that request's window result and might decompile it again.
The request now takes the planned window from its own function on.
* fix(rizin): terminate the owned debugger when cleanup cannot resynchronize
A Rizin debug command whose deadline expires while the target keeps running
leaves the debugger blocked with unread cleanup commands. Cleanup could not
observe its resynchronization marker, detach was never verified, and the
retained process outlived the MCP server with its target (issue #8779).
Detach results now carry an explicit `unavailable` declaration. Rizin returns
it when a bounded resynchronization probe (500 ms, inside the shared 1000 ms
detach budget) observes no marker. `stopOwnedDebuggerProcess` then terminates
the directly owned process and reports `stopped_inferior_unknown`, leaving the
inferior's disposition unknown instead of inferring it from a PID or path.
An observed marker followed by a refused detach still retains the cleanup
owner for retry, and a session whose output streams have not settled remains
retained. Rizin never signals the inferior, so its target may continue
running; timeout, cancellation and protocol-failure evidence name the
unverified detach and the unknown target state, as do the close contract,
the Rizin guide, and the runtime-observation skill.
Validation (rebased onto upstream/main at cdc4541ef):
- npm run test:focused -- 21 Rizin/GDB boundary and MCP files: 463 passed,
1 skipped (real Rizin 0.7.4 lane; the host runs 0.9.1).
- npm run test:coverage:reverse-tools: passed.
- npm run check:fast, format:check, metadata:check, docs:check,
verify:architecture-guards, knip:production and lint:typed: passed.
The repository-level knip task reports one pre-existing unused type
(src/domain/adb/adbDeviceAnalysis.ts) that reproduces on the clean base.
- Real Rizin 0.9.1 on Linux x64: on the base, a `dc` deadline left the
retained rizin process alive and closeAll raised retainedProcessIds; with
this change the command returns partial output with the new limitation,
the owned debugger is terminated, the target keeps running, and close
returns target_state unknown.
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): address Greptile P1/P2 and Codex review findings
* fix(rizin): keep the unknown target state when cancelled startup cannot detach
A startup that failed its protocol and was cancelled reported only the
cancellation. When cleanup then could not resynchronize and terminated
Rizin without a verified detach, the caller lost the only record that the
target may still be running, because the session is removed after the stop.
Cancellation stays the reported reason and the unverified detach is
retained as a secondary failure, as the protocol-failure branch already
states it. Also route the cleanup probe reason through errorMessage.
* test(rizin): use lifecycle assertions and typed failures
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(ghidra): cancel an active request without closing the session
Cancelling the request Ghidra is working on closed the whole session, so the next call paid for a restore or a full re-import and session annotations were lost.
The bridge now reads its connection on a second thread that only cancels the Ghidra TaskMonitor of the request a cancel frame names; requests still run one at a time. For an active read, REA writes that frame and waits up to two seconds for the request's reply. When it arrives, the call returns a cancellation and the session, its annotations and the queued requests stay. Edits are not interrupted, and a read that is not answered in time closes the session as before.
Refs #14832, #8223, #5340
* feat(ghidra): bound the cancel grace with a launch control
REA_GHIDRA_CANCEL_GRACE_MS replaces the fixed 2 s wait for the bridge to
answer a cancelled read before the session is closed. Default 2000 ms,
floor 100 ms, maximum 60000 ms.
The value is parsed when REA starts and fixed for a session when its
request queue is constructed. It is a restart-only launch control in the
numeric limit registry, not a runtime analysis setting, so the MCP tool
catalog is unchanged.
The session limitation states the applied value and its source, and the
failure of requests queued behind an expired grace names the control,
value, source and range. An invalid value is reported by doctor and
registration validation and refuses a Ghidra session.
The hang_tools client cases inject the 100 ms floor instead of waiting
out the default grace.
* fix(ghidra): keep capability limitations from claiming the default cancel grace
Capability descriptors are built once without a session, so they stated the 2000 ms default as the applied value even when REA_GHIDRA_CANCEL_GRACE_MS was set at launch. They now name the control and its default; session limitations still state the value applied.
* refactor(ghidra): drop the redundant pre-decompile cancellation check
DecompInterface.decompileFunction already returns a DISPOSED_ON_CANCEL result for a monitor cancelled before it starts, which the existing isCancelled() check reports as decompile_cancelled.
* test(ghidra): expect session limitations from the session owner in MCP parity
The parity check compared session Evidence with capability limitations. Since capability descriptors no longer state an applied cancel grace, the expectation is derived from ghidraSessionCommonLimitations with the grace this harness applies.
* fix(hopper): report the stalled export function and shell recovery
decompile_all reports a progress update every five seconds while one
function stays pending, naming the function and its position. MCP sends it
as a progress notification and the CLI as a rea_progress line on stderr.
A retained Hopper document now carries remediation that holds after a
one-shot command has ended: Hopper is still running the named operation and
must finish or be quit. The close_binary retry text is kept as guidance for
a continuing caller.
Refs #14840
* fix(hopper): qualify the advice to quit Hopper while it is still working
The recovery text for an ended invocation told the user to quit Hopper to stop
a running operation without the condition its sibling text carries. Hopper is
the user's application and may hold other documents, so the advice now applies
only when it has no other work.
* fix(decompile-all): time only provider requests when reporting a function wait
The wait reporter timed a whole function attempt, including journal appends and file commits, so a slow output volume was reported as the provider still decompiling. It now wraps each provider request (procedure_info and procedure_pseudo_code) and names the request it waits on. The progress test now uses phase gates and releases and joins the export on every path.
* docs(decompile-all): say the wait report times provider requests only
* fix(progress): rate-limit each progress phase separately
The shared reporter dropped any intermediate update within 100 ms of the previous one, whatever its phase. Hopper's one-second request heartbeat could therefore suppress every decompile_all wait report that fired just after it. The interval now applies per phase, so a heartbeat cannot hide a rarer update from another phase. The decompile_all progress test also restores its commitFunctionFile spy.
* perf(decompile-all): group durable writes per batch of functions
The export synced each function file and then the journal, one function at a time, so it spent about as long waiting on the disk as decompiling.
Each file's bytes are now synced in staging while later functions are decompiled. A group of up to eight functions then publishes its files in visit order and appends its journal records with one write and one sync. A journal record is still written only after its file's content is synced and published. Cancellation and failures commit the pending group before they are reported.
Files, journal records and their order, the index and counts are unchanged. A stopped process or host now leaves up to eight decompiled functions unrecorded instead of one; a resume decompiles them again and adopts files already in place.
Addresses #14830
* fix(decompile-all): commit the pending group on a throw and after one second
A provider adapter that threw inside a group dropped the functions already
decompiled in it: their staged files were removed and no record was written,
where each had been committed before the next was requested. The pending group
is now committed before the throw propagates.
A group is also committed by the first function that settles a second or more
after the previous commit, so a slow provider is committed function by function
instead of leaving up to eight long decompilations unrecorded.
Adds the missing lifecycle regressions: a caller abort during a group's
publication and during its journal append, a failed removal of a discarded
staged file, and a resume beside staging left by a stopped run.
* test(decompile-all): release the export a failed-discard test retains
The test left its export's cleanup failing, so the directory lease stayed held
by the test process. The lease is keyed by device and inode; where the
filesystem reuses the removed directory's inode, the next test's export was
refused as already running. The test now gives the export a resource scope,
retries the retained cleanup once removal works, and resumes in the same
directory, which also covers the cleanup retry.
* fix(decompile-all): retain failures the group commit observed after a stop or throw
A write failure that stops a group now keeps a later function's provider failure as a secondary failure, with its cleanup still attached. When a provider throws and the commit of earlier functions then fails, that commit failure is returned as primary and the throw is retained with it. The first provider failure before an independent retry now joins the group before the retry runs, so a retry that throws cannot drop it.
* refactor(decompile-all): compose every export failure through one owner
Group settlement now carries each entry's outcome: the first stop leads, entries after it are abandoned but keep any failure they observed, and a failed journal append leads those. One composeFailures helper retains later failures as secondary and keeps every cleanup they own, and the final publish/index/close composition uses it too, so an index failure that still owns cleanup is no longer dropped behind an earlier failure. A journal write failure also keeps a later invalid record as a secondary failure.
* fix(ghidra): report a held checkpoint lease as retryable contention
* fix(ghidra): tell a contention retry to reopen once the owner saved edits
A session that waited for a checkpoint lease keeps the generation it selected,
so after the owner saves Program edits and closes, repeating the call cannot
succeed. Report that outcome as a typed superseded failure with reopen
recovery instead of a checkpoint-directory configuration error, and say so in
the busy recovery.
* fix(ghidra): reuse completed decompiles and decompile code outside functions
* fix(ghidra): say what the procedure inventory omits and how to reach it
* fix(ghidra): say when a file offset maps to code outside every function
A file-offset selector that mapped to disassembled code without a function
failed with advice to choose an inventory procedure, which cannot name that
code. The failure now states the fact and that procedure_pseudo_code can
decompile it by the mapped analysis address.
One predicate now decides that an address holds code outside every function
for the address, file-offset and procedure_not_found paths, and the bridge
imports UndefinedFunction and SoftReference like its other dependencies.
* fix(ghidra): decompile code outside functions selected by file offset
A file offset names the same location as its mapped analysis address, but
an offset that mapped to code Ghidra disassembled without a function was
refused while the address decompiled. The offset now resolves through the
same on-the-fly UndefinedFunction path and limitation, and its selection
reports the inferred entry as procedure_address. The refusal that sent the
caller back to the address form is removed.
* fix(ghidra): keep reused decompiles across reads without decompiler options
A request that omits decompile_max_payload_mib now leaves the session's
payload limit unchanged instead of resetting it to the Ghidra default,
so an instruction or metadata read no longer discards completed
decompiles. An explicit null still selects the installed default.
Boundary limitations for a reused decompile of code outside every
function now use the function the decompile widened, not a fresh
entry-only UndefinedFunction.
* docs(ghidra): state what an omitted decompiler payload option means
Share max_file_bytes and max_strings schema bounds through a domain-owned V8_CODE_CACHE_BUDGETS table and attach details.limit to both inspect_v8_code_cache budget refusals (Refs #14234).
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Share source_map_limits bounds through a domain-owned SOURCE_MAP_BUDGETS table and attach details.limit across local source-map read, decoder admission, codec reply, and memory/output limit refusals (Refs #14234).
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Define WASM_INTERFACE_BYTE_BUDGET in src/domain/wasm/wasmInterface.ts so wasmInterfaceByteBudgetSchema and WasmInterfaceBudget share one owner, and attach details.limit to max_interface_bytes refusals (Refs #14234).
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Share max_file_bytes bounds through API_CONTRACT_FILE_BYTES_BUDGET in src/domain/apiContract/apiContractQuery.ts, attach details.limit with required_value in ApiContractRead, mark V8 parser heap headroom refusals as measuredExhaustion, and drop all three entries from the untyped refusal baseline (Refs #14234).
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(browser): bound armed timeline rows by the retained-event allowance
Armed timeline rows were appended with no byte budget. Pre-arm
messages and document request identities already stop at the
retained-event allowance.
Count each armed row before keeping it. A row that does not fit fails
the observation with payload_limit and does not return a shorter
timeline. Event count has no separate ceiling.
* chore(browser): format the timeline allowance check
oxfmt --check rejects the wrapped comparison in TimelineCapture.#add.
* fix(browser): give timeline retention a caller control
Armed timeline rows use browser.timeline_retained_bytes. A call can pass
timeline_retained_bytes. Request identities keep a separate counter.
A row that does not fit returns payload_limit with details.limit, including
a row admitted during terminal progress.
* fix(browser): refresh advertised schemas for the timeline allowance
The new setting and per-call field change the compact input hashes for
observe_web_session, inspect_analysis_settings, and update_analysis_settings.
* fix(browser): report measured timeline bytes without required_value
Admission stops at the first row that does not fit, so later rows are
unknown. measured_timeline_bytes records the rows already measured.
The budget test waits until all four lifecycle events are delivered.
* fix(cli): isolate a synchronous resource-closer throw
closeCliResources invoked each closer while building the
Promise.allSettled input. A closer that threw before returning a
promise left that call, so later owners did not run.
Start each closer on its own turn. A synchronous throw stays with
that owner, and every other owner still settles. Closers stay
registered, so a later close retries them.
A failed registration can request process exit twice. The first
request now owns shutdown. A second registration fail or host exit
returns without starting another resource close or exit timer.
* test(cli): exercise duplicate exit after rendering failure
---------
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
* fix(browser): reject a file URL with a hostname
A file URL names another host when its hostname is not empty. The navigation hook blocks that URL. An empty host stays allowed, including file://localhost, because the URL standard ignores that host.
* test(browser): cover a blocked file-host redirect
The file-host regression emits will-redirect for a remote file URL and a local file URL. Dropping the redirect check leaves preventDefault unset and fails the test.