Skip to content

feat: compose clean agent lifecycle states - #513

Merged
schickling merged 1 commit into
mainfrom
schickling/2026-09-07-issue-434
Sep 8, 2026
Merged

schickling merged 1 commit into
mainfrom
schickling/2026-09-07-issue-434

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Lifecycle state was interpreted independently by declaration parsing, validation, authoring, rendering, and hooks. Suspended and retired declarations could therefore fail checks for runtime resources that they do not use.

Goal

Use one typed lifecycle projection. Validate durable declaration structure in every state, but require runtime readiness only for running declarations. Let lifecycle teardown and repair proceed when an unrelated catalog error already exists.

Decisions

  • DeclaredAgent::lifecycle() is the shared parser for implicit running, canonical desired-state, and legacy retired forms. The legacy form remains readable but emits no warning.
  • Structural checks apply in every lifecycle state. Address and topology ownership apply to running and suspended declarations. Ambient readiness applies only to running declarations.
  • Lifecycle mutation compares incumbent and prospective core-error multisets on the same filtered shadow. It refuses only newly introduced errors. Strict candidate publication remains unchanged.
  • The catalog-root publication fence from the earlier draft is removed. That concern is outside issue st2 agent desired-state retired writes a declaration that fails admission, silently making the target un-editable #434.

Verification

  • cargo test -p agent-spec --test declared_document: passed.
  • cargo test --test validate --test materialize --test catalog_diff --test agent_desired_state: passed.
  • Reviewer regression proofs for external absolute render sources, filtered-shadow symmetry, declarations without explicit hosts, marker authority, and invariant references: passed.
  • axe vrs check --profile strict docs/vrs: passed.
  • cargo test --all-targets --all-features --jobs 4: the library suite passed (782 passed, 1 ignored), all suites before catalog_apply passed, then catalog_apply reported 48 passed, 14 failed. The same 14 named failures were reproduced against current origin/main at 63ddfbe; this branch introduces no additional failure.

Pre-flip deviations: the repository-wide formatter and clippy gates have existing drift on untouched code. No dependency was added.

Complexity

The change reuses the existing parser, validator, and catalog lock. The only new admission mechanism is a stable error-identity multiset for lifecycle deltas.

Concerns

Lifecycle authoring validates the complete catalog twice under the existing lock. Error prose is retained and formatted only for strict validation, not for lifecycle comparisons.

Friction & bottlenecks

The full test run was delayed until shared memory pressure recovered, then ran with four Cargo jobs. The pre-existing catalog_apply failures required a detached current-main comparison.

Follow-ups

  • Remove the legacy retired reader after declarations have migrated.
  • Repair the pre-existing catalog_apply fixtures separately.

References

Closes #434
Related: #509

Posted on behalf of @schickling
field value
agent_identity dev3.direct.omp.7hxyzb4a
session dev3.7hxyzb4a
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.1.7
agent_runtime OMP 18.1.7
tooling_profile dotfiles@d1a9afb

agent-identity: dev3.direct.omp.7hxyzb4a
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.1.7
agent-runtime: OMP 18.1.7
tooling-profile: dotfiles@d1a9afb
@schickling-assistant
schickling-assistant force-pushed the schickling/2026-09-07-issue-434 branch from 7468956 to 9082f6f Compare September 8, 2026 13:30
@schickling-assistant
schickling-assistant marked this pull request as ready for review September 8, 2026 13:34
@schickling
schickling merged commit 87cce1f into main Sep 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st2 agent desired-state retired writes a declaration that fails admission, silently making the target un-editable

2 participants