fix(ci): restore main workflows and captured-state replay (#9763)

* fix(cli): record the caller HAR path in environment-build evidence

environment-build inspected a HAR without the caller path that
inspect-web-network-capture records, so the published evidence.json
omitted caller_input_path and failed the byte-for-byte portable check.

Also update three stale portable expectations that already fail on main:
the no-reader verifier digest matches the #9185 selector parent, uncapped
IDA callee pages report complete discovery, and a CLI refusal of a
malformed artifact inspection includes the undelivered source closure.

* fix: restore portable docs, alias, offset, and Windows cleanup checks

The witness page linked task anchors that were never written, so any
docs-touching PR failed the route check. A selected state directory was
restored as a dangling symlink by a duplicated helper. An empty
safetensors file reports the extent as outside the file before offset
conversion. Windows cleanup refusal uses the runtime's in-progress message.

* fix(cli): keep the caller's HAR spelling in environment-build evidence

inspect-web-network-capture records the path the caller typed. The
one-shot build had already absolutized that path, so a relative capture
disagreed with the three-step bundle. The byte-for-byte check now runs
from the capture directory and requires caller_input_path grafana.har.

* fix(desktop): create alias targets only for directory selections

A missing settings file was created as a directory because the helper
treated any absent path as a directory. The capture's selected path kind
now travels with the alias, and only a directory alias creates its target.
An absent file alias stays a file the app can create.

* fix(desktop): keep legacy alias kind unknown

Captures written before selected_paths.kind leave the alias unknown.
Defaulting those to a directory makes an omitted settings file a
directory, so a later write through the alias fails with EISDIR.

* fix(desktop): keep alias kind a file, directory, or unknown

The export plan was widening a missing selected path kind to string.
Record file or directory only when the capture says so, and unknown otherwise.

* fix(desktop): narrow a missing alias kind to unknown

The selected path kind was widened to string, so the export plan could
not keep the file, directory, or unknown distinction.

* test(desktop): expect alias kind in the rendered app module

The export now records whether a selected alias is a directory. The
rendered STATE_ALIASES tuples include that kind.

* fix(ghidra): reject an oversized Windows TCP endpoint as invalid

The POSIX read maps a record past the compact endpoint bound to
"Ghidra TCP endpoint is invalid". The Windows lease reported that same
bound as a generic observation failure, so an expanded endpoint failed
the Windows lane with a different message.

* fix(desktop): create a legacy alias when a child proves it is a directory

A capture written before selected path kind can still nest one alias
inside another. That parent is a directory. A legacy leaf stays unknown
so a missing settings file is not created as a directory.

* fix(desktop): restore selected aliases when the app owns no files

An empty state directory does not become an owned path, so the class
was ownless and never called _ensure_state_aliases. The ownless class
now restores aliases whenever the export recorded some.

* fix(desktop): create the parent of a missing file alias

A file alias must stay a file. When its parent directory was not seeded,
the symlink was dangling and a write through it failed with ENOENT.

* ci: retrigger checks after an unrelated Windows timeout

The Windows lane timed out in webModuleCli, which this diff does not touch,
and the rerun API is unavailable.

* test(evidence): preserve complete CLI refusal diagnostics

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-11-10 06:37:51 +01:00
1 parent d4a7c20e04
commit 95ebd38d3f
13 files changed
+222 -62

No files matched your search

+23 -27
View File
@@ -153,38 +153,25 @@ def _seed_home(home: Path) -> None:
def _ensure_state_aliases(home: Path) -> None:
"""Restore selected aliases without replacing any existing user data."""
aliases = sorted(STATE_ALIASES, key=lambda pair: len(Path(pair[0]).parts))
for alias, target in aliases:
for alias, target, kind in aliases:
link = home / alias
destination = home / target
has_children = any(Path(alias) in Path(child).parents for child, _ in aliases)
# A recorded directory is created. A legacy alias with no kind is
# created only when another alias is inside it, which proves it is a
# directory. A legacy leaf stays unclassified so a missing file is not
# turned into a directory.
has_children = any(Path(alias) in Path(child).parents for child, *_ in aliases)
if kind == "directory" or (kind == "unknown" and has_children):
destination.mkdir(parents=True, exist_ok=True)
elif kind == "file":
# The file itself stays absent so the app can create it. Its parent
# has to exist or that write fails with ENOENT.
destination.parent.mkdir(parents=True, exist_ok=True)
if link.is_symlink() and link.resolve() == destination.resolve():
if has_children:
destination.mkdir(parents=True, exist_ok=True)
continue
if os.path.lexists(link):
raise FileExistsError(f"Cannot restore selected state alias; path already exists: {link}")
link.parent.mkdir(parents=True, exist_ok=True)
if has_children:
destination.mkdir(parents=True, exist_ok=True)
link.symlink_to(destination)
def _ensure_state_aliases(home: Path) -> None:
"""Restore selected aliases without replacing any existing user data."""
aliases = sorted(STATE_ALIASES, key=lambda pair: len(Path(pair[0]).parts))
for alias, target in aliases:
link = home / alias
destination = home / target
has_children = any(Path(alias) in Path(child).parents for child, _ in aliases)
if link.is_symlink() and link.resolve() == destination.resolve():
if has_children:
destination.mkdir(parents=True, exist_ok=True)
continue
if os.path.lexists(link):
raise FileExistsError(f"Cannot restore selected state alias; path already exists: {link}")
link.parent.mkdir(parents=True, exist_ok=True)
if has_children:
destination.mkdir(parents=True, exist_ok=True)
link.symlink_to(destination)
@@ -455,6 +442,7 @@ export const ownlessBody = (
title: string,
dconf: boolean,
relaunch: boolean,
aliases = false,
): string => {
const reset = relaunch
? `
@@ -466,14 +454,22 @@ export const ownlessBody = (
const serves = relaunch
? "and keeps its task's state on screen, so its reset only relaunches it"
: "so it serves no data operations";
const restore = aliases ? "\n _ensure_state_aliases(Path.home())" : "";
if (dconf)
return ` """${title}, launched at boot with its captured settings. It owns no files, ${serves}."""
def __init__(self) -> None:
super().__init__()
_load_dconf(Path.home())
_load_dconf(Path.home())${restore}
${reset}${PYTHON_READY_CHECK}`;
if (!aliases)
return ` """${title}, launched at boot. No state was observed, ${serves}."""\n${reset}${PYTHON_READY_CHECK}`;
return ` """${title}, launched at boot. No state was observed, ${serves}."""
def __init__(self) -> None:
super().__init__()
_ensure_state_aliases(Path.home())
${reset}${PYTHON_READY_CHECK}`;
return ` """${title}, launched at boot. No state was observed, ${serves}."""\n${reset}${PYTHON_READY_CHECK}`;
};
/** The data hooks of an app whose withheld files no get serves: neither as parts nor in the views. */