Commit Graph
2391 Commits
Author SHA1 Message Date
Léo 2a540f2acc fix(runtime): enforce workspace confinement in one place
"Is this path inside that root" is asked in twenty places in this tree and
answered twenty times by a locally written realpath/commonpath pair. Nine test
files exist because nine call sites each needed their own proof. Each one is
defensible alone; together they are the defect, because the boundary has no
single definition and a site that gets a detail wrong is wrong by itself.

src/path_confinement.py is that definition, and it settles the details the
copies disagreed on. Both sides get canonicalized: comparing a realpath-ed
candidate against a root that was only abspath-ed is the macOS /tmp ->
/private/tmp mismatch that has already produced a false failure here, and
canonicalizing one side is worse than canonicalizing neither. commonpath rather
than startswith, because /a/bc begins with /a/b and is not inside it. A relative
candidate joins the root rather than os.getcwd(), which is whatever directory
the server happens to be running in. NUL and newline are refused with a reason
instead of caught by a bare `except Exception` and reported as an ordinary
escape. Eighteen call sites go through it now. It deliberately does not decide
whether a path is sensitive -- that deny list answers "allowed" rather than
"inside", and it stays with src/tool_execution, which owns it. The one
commonpath left in the tree, in src/workspace_paths.py, stays: that function
translates a host path into a container path, so canonicalizing either side
would change the relative path it computes and break the mapping. It is not a
confinement check.

Two of those sites were weaker than the rest and are fixed rather than moved.
The email attachment check used abspath, which folds `..` but does not resolve
symlinks, so a symlink written into the extraction directory passed it and was
then read through. The skill-reference guard compared a realpath-ed target
against a raw dirname, so on a host where the skills tree is reached through a
symlink the two sides never matched and the guard could not fire.

The execution boundary had two separate holes.

The workspace namespace bound /home and /mnt read-write. On the one platform
where that namespace engages at all, a command inside it reaches outside the
workspace and writes to the user's home directory -- measured by running this
argv on a Linux host with working bubblewrap, not inferred from the source.
Binding the user's whole home directory into a workspace-confinement namespace
gives back most of what the namespace was for. Both are read-only now. The
workspace is also bound writable at its real host path, not only at /workspace:
BashTool's own /tmp redirect rewrites `/tmp/` to `<agent_cwd()>/.tmp/` before
the namespace is built, so the command bwrap receives already names the real
path, and those writes previously landed only because the workspace happened to
sit under the writable /home.

`namespaced or _replace_workspace_alias(...)` chose between a mount namespace
and a regex with nothing in the result saying which one ran. The fallback
rewrites the literal token /workspace in the command string, so a command that
never mentions /workspace is untouched by it and runs on the host unrestricted
-- which is every agent shell command on macOS. Both tools now ask
containment.probe() instead of each deciding for itself, and every bash and
python result carries a containment block naming the mechanism and stating
whether the filesystem dimension actually held. Under enforcing mode the
command is not run and the result says so.

That block reports the filesystem dimension only, and says so in a
reported_dimensions field. The probe knows this host could also give a process
group and a real wall clock, but these two tools still assemble their own
create_subprocess_* call and pass neither, so listing those dimensions would be
exactly the false claim src/containment.py calls worse than an honest absence.

probe() is new on src/containment.py: the same mechanism table and the same
arithmetic as acquire(), stopping before the side effects. acquire() is the
wrong shape for a decision -- it writes a durable grant record, and a record
whose pid is never filled in and whose release() never runs is an entry a
restart reaper keeps finding.

CONTAINMENT_MODE stays report_only. Flipping it refuses every agent shell
command on macOS and on any Linux host without bubblewrap, which is a product
decision rather than a code one.

Smaller things in the same area: the /tmp redirect's makedirs was unguarded, so
a read-only workspace turned a command that merely mentioned `/tmp/` into an
OSError traceback instead of a tool error; it degrades now. WORKSPACE_MOUNT
moved to src/constants.py so the namespace and the path resolvers read one
definition of the contract rather than two. The ".tmp" dirname got a constant,
since it appeared in both tool paths.

One generated artifact moved with it: website/configuration-reference.md pins
the source line where each ODYSSEUS_* variable is read, and three of those
shifted. Regenerated with scripts/generate_env_reference.py; the diff is line
numbers only.

Three existing tests changed. test_workspace_artifact_tool_floor asserted that
an unsafe interpreter prefix produces no `--ro-bind <prefix> <prefix>`, which
now fires on /home because /home is legitimately a read-only base mount.
Asserting the absence of a literal flag string cannot distinguish "the prefix
was rejected" from "the argv mounted that root itself", so it compares the argv
against the no-prefix baseline instead: an unsafe prefix must add nothing.

The Windows bash test asserted dict equality on the
whole result, which makes adding a field to every bash result impossible without
touching a test about tmux; it asserts the shape now. The personal-dir symlink
test grepped the resolver's source for the literal "os.path.realpath", which is
gone because the resolution moved into the shared boundary -- it keeps the
negative assertion that the closure must not grow its own abspath check again,
and the behavioural half now runs against the boundary, where it covers every
call site instead of one closure.

Not verified: the bubblewrap argv is asserted, not executed. There is no bwrap
on macOS, and in Docker it needs --privileged to work at all -- default and
seccomp=unconfined both fail with "Creating new namespace failed", and
--cap-add=SYS_ADMIN fails at pivot_root. The Python tool's
needs_virtual_namespace gate means ordinary Python code gets no namespace even
on a Linux host that could provide one; that is reported now but deliberately
not changed, because it alters the Linux Python path on every call and cannot be
checked from here.
2026-10-01 19:45:59 +02:00
Léo c004a26d46 fix(runtime): verify process identity before any teardown signal
A recorded pid is a claim, not a handle. The containment grant store, the
background-job store and the Cookbook task list all outlive the process that
wrote them — deliberately, so a restart keeps a job and its result — and the
kernel reuses pids. Any teardown driven off one of those records can therefore
land on a process we never started. ODY-86 was exactly this, and the Cookbook
survivor sweep still terminated any process whose full command line matched a
tracked one, which is the same mistake spelled differently.

Identity is (pid, start token). The token comes from /proc/<pid>/stat on Linux,
ps -o lstart= on macOS and the BSDs, and GetProcessTimes on Windows; the kernel
will not hand a pid to a process that started earlier, so comparing the token
recorded at launch against the token read now answers "is this still ours"
without a handle or a supervisor. verify() returns owned, gone, foreign or
unverifiable, and only owned permits a signal.

Keeping "unverifiable" out of the other two is the point. Process inspection
has broken off Linux four times here — ODY-70, -86, -94, -99 — every time
because an absent mechanism read as a successful answer. Folding it into "ours"
signals strangers; folding it into "gone" abandons live processes. It is a
containment failure and every caller treats it as one.

Wired into the three places that signal:

- containment.release() gates a grant recovered from the durable store, and
  leaves an in-process teardown alone, where the caller holds the child and no
  identity question arises. The verdict lands on the record, so "why is this
  grant still here" is answerable afterwards.

- A startup reaper. Nothing read either store before, so a crashed run left
  every grant permanently active and every job permanently running, and the
  first thing to touch such a record was a teardown aimed at a reassigned pid.
  The two stores get opposite treatment: an orphaned grant has no caller left
  and is torn down, while a detached job is documented to survive a restart and
  is only corrected, never killed.

- The Cookbook sweep takes its ownership from the tmux pane's process tree,
  captured before the kill destroys the only link between a surviving model
  server and the session that started it. A process that merely matches the
  tracked command line is now reported rather than killed: the Cookbook
  composed that command line, so an identical one is just as likely to be a
  server the user started by hand. The sweep also runs on hosts with no procfs
  instead of silently skipping, and says so when it could not look at all.
2026-10-01 18:55:50 +02:00
Léo 33fa27b4c8 feat(runtime): add the containment boundary and its failure contract
Agent-reachable execution has 25 independent spawn sites and no single
place deciding where a process runs or under what limits. All three
consequences are visible on this SHA. When bwrap is absent the workspace
namespace degrades to a regex that rewrites /workspace to the real path,
and nothing in the tool result says which one you got. No spawn site
passes start_new_session, so a wall-clock kill reaches the wrapper shell
and leaves its backgrounded grandchildren running while reporting the
process killed. Teardown stops at SIGTERM without ever checking death.

src/containment.py gives those paths one boundary. acquire() establishes
containment or refuses -- a string rewrite is not a mechanism it can
select -- and the grant states which dimensions actually hold, which were
best-effort and are missing, and which were required and are missing.
run() enforces the wall clock and the output cap. release() signals the
process group, escalates to SIGKILL, and reports dead only for a group it
observed go empty.

Containment never sees the command: acquire() takes a workspace and
limits, and the command text only reaches run(). Nothing in a request can
widen a boundary it is never shown.

CONTAINMENT_MODE chooses between refusing an unestablishable required
dimension and recording it. It ships report-only, so landing this changes
no behaviour on a host without bwrap -- which is every host today.

No call sites move here; they follow on this branch. The configuration
reference is regenerated because the page records src/constants.py line
numbers and the new path constant shifts two of them.
2026-10-01 17:55:33 +02:00
Alexandre Teixeira 05c6cfcfa1 Merge pull request #43 from pewdiepie-archdaemon/feature/agent-runtime-wave-1-1
feat(runtime): complete Agent Runtime Wave 1.1
2026-10-01 15:22:06 +01:00
Alexandre Teixeira d49071bbec fix: close Wave 1.1 completion-gate audit findings
- Headless consumers (task scheduler, background follow-up) now treat a
  completion-gate final_response as the authoritative answer instead of
  collecting deltas only. A gated replacement no longer leaves scheduled
  output empty, which used to trigger an extra, ungated grace-summary
  model call.
- The scheduler closes the agent stream with contextlib.aclosing, so the
  approval-pause break unwinds the gate's journal and teacher-takeover
  context in its own task. Chained runs no longer inherit a stale
  parent_run_id, and later finalization no longer raises ContextVar
  reset errors.
- On provider error, the completion gate applies the live answer's
  statement filter to persisted round_texts. Diagnostics and the failure
  note survive; claims rejected by the gate cannot reappear on reload.
2026-10-01 14:49:32 +01:00
Alexandre Teixeira f4793696f4 merge: reconcile Wave 1.1 with post-PR40 lab
Merge canonical lab 9557b8d5909eb4a885c3bf49e19a65dd904f8c1d exactly once.
Retain invocation journal ownership and lineage, provider terminal ordering,
teacher handoff, framed DONE handling, and canonical authority/Ajax routing.

Combine dynamic dispatch receipts with lab policy forwarding. Adapt native
shell/patch evidence, explicit TUI verifiers, and artifact recovery presentation.
Refresh generated configuration source links and strengthen adapter regressions.

Validation: focused 2118 passed; Wave 1.1 script 2291 passed; broad runtime
5649 passed; full pytest 11581 passed, 53 skipped, 2 xfailed, 6 subtests passed.
Compileall 1689 Python files; syntax 279 JS and 82 MJS files; diff and
conflict-marker checks passed.
2026-10-01 09:09:55 +01:00
Alexandre Teixeira e5e23e640d Merge pull request #40 from pewdiepie-archdaemon/review/harness-latest-20260917
Review preview harness, editor, email and task improvements
2026-10-01 06:59:19 +01:00
Alexandre Teixeira 5dfe1c353c test: stabilize final PR 40 validation gates 2026-10-01 06:39:22 +01:00
Alexandre Teixeira f74a262f73 merge: reconcile PR 40 with current lab
Integrate lab fff55a78 into PR #40 (cc25d5ba). Lab's modular email
backend/frontend, modular settings, split stylesheets (static/style.css
stays deleted), procfs compatibility, and request-scoped TurnContract
authority win; PR #40's routing classifiers, editor/email/task features,
and style.css changes are ported into lab's module and stylesheet homes.

Integration fixes:
- settings/api.js imports ui.js under its canonical versioned URL
- browser observations keep legacy CAPTCHA/access-block evidence
- artifact turns do not re-trigger broad-web research recovery
- env reference documents PR test-tool variables; page regenerated

PR #40 defects surfaced by lab gates and fixed here:
- web_fetch generic schema drops top-level anyOf (OpenAI contract);
  the compact preview contract still requires url or urls
- get_weather registered as a brokered network read
- new lazy editor modules precached for offline use
- SearXNG pin mirrored into GPU standalone compose files
- image model picker again skips offline endpoints

Tests updated where PR #40 changed behaviour on purpose, and PR tests
moved onto lab's document_source helpers.
2026-10-01 05:03:58 +01:00
Alexandre Teixeira f93767d5c7 Merge pull request #17 from o3LL/fix/procfs-pid-file-liveness
fix(browser): stop treating a missing cmdline as proof the daemon exited
2026-10-01 03:10:43 +01:00
Alexandre Teixeira d63932f1ad Merge lab into fix/procfs-pid-file-liveness 2026-10-01 03:10:10 +01:00
Alexandre Teixeira a462e01483 Merge pull request #39 from o3LL/feat/admin-build-provenance
feat(settings): show the running build's version and commit in the admin panel
2026-10-01 02:55:54 +01:00
Alexandre Teixeira 6901c56192 Merge lab into feat/admin-build-provenance 2026-10-01 02:55:27 +01:00
Alexandre Teixeira f817ab6e09 Merge pull request #35 from o3LL/docs/env-configuration-reference
docs: generate the ODYSSEUS_* configuration reference from the source
2026-10-01 02:53:07 +01:00
Alexandre Teixeira c6f690a27b Merge lab into docs/env-configuration-reference 2026-10-01 02:52:37 +01:00
Alexandre Teixeira 762fb891ce Merge pull request #29 from o3LL/test/95-release-smoke-suite
test(smoke): add a release smoke suite over every advertised feature area
2026-10-01 02:46:16 +01:00
Alexandre Teixeira bdccb1ddb1 Merge lab into test/95-release-smoke-suite 2026-10-01 02:45:49 +01:00
Alexandre Teixeira 95416cdbfb Merge pull request #27 from o3LL/audit/ref-parity
chore(tools): add a read-only ref-to-ref parity audit
2026-10-01 02:45:38 +01:00
Alexandre Teixeira ef0d96a3ae Merge lab into audit/ref-parity 2026-10-01 02:45:10 +01:00
Alexandre Teixeira fe7297547c Merge pull request #38 from o3LL/test/runtime-behavior-regressions
test(runtime): pin negative capability wording, test-only
2026-10-01 02:42:50 +01:00
Alexandre Teixeira 8c7e3a9411 Merge lab into test/runtime-behavior-regressions 2026-10-01 02:42:22 +01:00
Alexandre Teixeira 1dca85cb07 Merge pull request #37 from o3LL/fix/token-cache-atomic-swap
fix(auth): swap the API token cache atomically instead of clearing it
2026-10-01 02:42:09 +01:00
Alexandre Teixeira 45e1e2e7d9 Merge lab into fix/token-cache-atomic-swap 2026-10-01 02:41:41 +01:00
pewdiepie-archdaemon 2e8413a54a Preserve preview harness, editor, email and task improvements
Snapshot current maintainer-preview application changes and regression fixtures for integration into lab. Excludes local runtime data, evaluation outputs and source backups. Focused Python regression selection: 140 passed; full suite not certified.
2026-10-01 01:34:26 +00:00
Alexandre Teixeira bf76c9c608 Merge pull request #36 from o3LL/fix/6174-singleflight-cancel
fix(tasks): clean up the singleflight cache on cancellation
2026-10-01 02:28:18 +01:00
Alexandre Teixeira b0bc0b8c40 Merge lab into fix/6174-singleflight-cancel 2026-10-01 02:27:49 +01:00
Alexandre Teixeira 236baea232 Merge pull request #33 from o3LL/refactor/email-library-package
refactor(email): decompose emailLibrary.js into a package behind a re-export wrapper
2026-10-01 02:23:56 +01:00
Alexandre Teixeira 799adbbde6 Merge lab into refactor/email-library-package 2026-10-01 02:22:23 +01:00
Alexandre Teixeira eef390b9ae Merge pull request #22 from o3LL/refactor/routes-email-subpackage
refactor(routes): move the email modules into routes/email/
2026-10-01 02:17:29 +01:00
Alexandre Teixeira 9477616e05 Merge lab into refactor/routes-email-subpackage 2026-10-01 02:15:36 +01:00
Alexandre Teixeira aedec7d005 fix(runtime): isolate nested invocation ownership 2026-10-01 02:11:53 +01:00
Alexandre Teixeira b35010c3d1 Merge pull request #24 from o3LL/refactor/settings-shell-modules
refactor(settings): move the shell out of settings.js into settings/
2026-10-01 01:42:18 +01:00
Alexandre Teixeira 33387d4a4c Merge lab into refactor/settings-shell-modules 2026-10-01 01:41:27 +01:00
Alexandre Teixeira 4c122de880 fix(runtime): scope completion claims to execution obligations 2026-10-01 01:36:18 +01:00
Alexandre Teixeira 290bb0d61d Merge pull request #23 from o3LL/refactor/settings-panel-modules
refactor(settings): extract four panels into settings/ modules
2026-10-01 01:08:58 +01:00
Alexandre Teixeira 9ee9205bfc merge: sync lab after stylesheet split 2026-10-01 01:08:15 +01:00
Alexandre Teixeira 86212bfe99 Merge lab into refactor/settings-panel-modules 2026-10-01 01:03:49 +01:00
Alexandre Teixeira 0f23439a31 Merge pull request #20 from o3LL/refactor/split-style-css
refactor(css): split style.css into ordered fragments
2026-10-01 00:55:35 +01:00
Alexandre Teixeira 23fdc26079 Merge lab into refactor/split-style-css 2026-10-01 00:48:58 +01:00
Alexandre Teixeira 466a6b323a fix(runtime): preserve provider error terminal ordering 2026-10-01 00:33:46 +01:00
Alexandre Teixeira fe80eb795e merge: reconcile reviewed lab baseline for runtime wave 1.1 2026-10-01 00:25:42 +01:00
Alexandre Teixeira 0a88b3c322 Merge pull request #31 from o3LL/test/document-module-set-helper
test(document): read the editor through a module-set helper before it is split
2026-09-30 22:59:49 +01:00
Alexandre Teixeira 40dbe17a95 Merge lab into test/document-module-set-helper
Resolve the overlap with #19 by preserving the whole-cascade stylesheet
helpers alongside #31's document-source/module-set helpers.

Maintainer validation:
- document/module contract and composition guards: 15 passed
- all 54 touched Python test modules: 366 passed
- py_compile: clean
- git diff --check: clean
2026-09-30 22:56:56 +01:00
Léo 40678bc466 feat(settings): show the running build's version and commit in the admin panel
Nothing in the UI said which build was loaded. /api/version has reported
version, build and source_commit since the harness started versioning itself
apart from the public semver, but the only way to read it was to curl the
endpoint — so "is the preview actually running the commit I just merged?" took
a terminal to answer.

Pins a footer under the settings sidebar nav showing the registered version
(plus the harness build when it differs) and the short source commit, with the
full hash on hover. It sits outside the nav's scroll container so it stays at
the bottom-left, and it is .admin-only, so syncAdminVisibility() hides it from
non-admins the same way it hides the Admin nav group.

The commit resolves at import via `git rev-parse HEAD` and is the string
"unknown" when that fails — a read-only Docker tree with no .git. The footer
treats "unknown" as absent and stays hidden when nothing is left to show,
rather than printing it. The collapsed rail and the two narrow tab-rail
layouts hide it too: neither has a bottom-left to write in.
2026-09-30 22:59:58 +02:00
Alexandre Teixeira 741f5dff2b Merge pull request #19 from o3LL/refactor/tests-read-the-whole-cascade
refactor(tests): read the whole cascade instead of style.css alone
2026-09-30 19:27:58 +01:00
Alexandre Teixeira 6ee51fee72 Merge pull request #18 from o3LL/fix/duplicate-keyframes
fix(css): collapse duplicate @keyframes names to the definition that wins
2026-09-30 19:18:13 +01:00
Alexandre Teixeira a969a68016 Merge pull request #34 from o3LL/test/macos-failures-and-stub-leak-guard
test: fix environment-dependent failures and guard module-stub leaks
2026-09-30 19:16:43 +01:00
Alexandre Teixeira 56484df737 test(media): detect ffmpeg encoders by codec alias 2026-09-30 19:16:29 +01:00
Alexandre Teixeira eaddc03729 Merge pull request #26 from o3LL/fix/tmp-realpath-test-bugs
fix(tests): resolve temp paths consistently on macOS
2026-09-30 18:21:04 +01:00
Alexandre Teixeira bfae249120 Merge pull request #28 from o3LL/fix/cookbook-stop-procfs-guard
fix(cookbook): skip the pid sweep when the host has no procfs
2026-09-30 18:07:07 +01:00