perf: keep agent publication on declaration plane - #520
Merged
schickling merged 2 commits intoSep 10, 2026
Merged
Conversation
agent-identity: dev3.direct.omp.fuksjr5z agent-persona: generalist agent-supervisor: unavailable agent-tool: OMP agent-tool-version: 18.1.7 agent-runtime: OMP 18.1.7 tooling-profile: dotfiles@8d937c9
agent-identity: dev3.direct.omp.fuksjr5z agent-persona: generalist agent-supervisor: unavailable agent-tool: OMP agent-tool-version: 18.1.7 agent-runtime: OMP 18.1.7 tooling-profile: dotfiles@8d937c9
schickling-assistant
marked this pull request as ready for review
September 9, 2026 21:06
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
st2 agent publishbuilt its prospective validation shadow by recursively copying runtime state from canonical agent directories that had no adjacent declaration. On a representative catalog with 140,255 files, one idempotent publication took 14.56 seconds and issued 135,708unlinkatcalls while cleaning the temporary shadow.Bundle capture also traversed
.workspacedescendants even though the catalog contract defines only the empty.workspacedirectory as declaration input.Goal
Keep publication work proportional to the declaration plane, not runtime-state size, while preserving both full validation passes and the complete transaction safety contract.
Decisions
agents/<host>/<identity>directory as a runtime-state parent, independent of whether an adjacent declaration exists. The filter remains path-structural; directories namedresourceselsewhere are not excluded..workspaceas one empty real-directory fact. Never enumerate, hash, copy, or publish its descendants.Rejected: skipping a validation pass based on caller behavior.
st2 agent publishremains a standalone fail-closed transaction.Verification
Representative release-build publication, same catalog and declaration:
With OTLP export enabled, the same five runs had a 0.855-second median; one run reached 1.181 seconds. Syscalls fell from 135,708 to 649
unlinkatand from 27,052 to 738copy_file_rangecalls.Passed locally:
Pre-flip deviation: this repository has no
devenv.nix, sodevenv tasks run check:allis unavailable. The repository-owned hermetic Nix package gate above passed.Complexity
No new dependency or public API. The capture mode adds one internal distinction between agent bundles and prepared catalogs.
Concerns
Telemetry exporter shutdown adds visible variance near the one-second boundary. This PR removes declaration publication I/O; it does not change telemetry flushing.
Open PRs #517, #490, and #160 also touch
src/catalog_transaction.rs, but their current diffs do not overlap these hunks.Friction & bottlenecks
The repository-owned Nix package gate took 8 minutes 40 seconds. The catalog-state traversal itself was the measured bottleneck addressed by this PR.
Follow-ups
Re-measure
new-agentend to end after the optimized st2 revision is consumed. Publication was the dominant phase, but account selection, supervisor preflight, telemetry, and provider readiness remain outside this PR.References
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimetooling_profile