Skip to content

fix(ai): discover persistence from native capability captures - #313

Merged
ice-black-tea merged 4 commits into
masterfrom
fix/custom-capability-discovery-230-20261114
Nov 15, 2026
Merged

ice-black-tea merged 4 commits into
masterfrom
fix/custom-capability-discovery-230-20261114

Conversation

@ice-black-tea

@ice-black-tea ice-black-tea commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Current delivery · 2026-11-15

The discovery fixes and their ownership evidence are complete for this PR. The recovery section in domain-composition.md maps ordinary retry, imported retry, same-execution deferred continuation, seed receipts, and native callback ownership to existing tests, without adding a new API or mechanism. On the combined source with master 18165a4, the focused suite passed 45 tests; independent review found no remaining must-fix item in this slice. Latest a11dc7d0 is Ready; natural CI is pending at publication. This does not complete #230 or establish general cold-process recovery.

Scope

Refs #230. Fix custom native capability-tree persistence discovery without changing public APIs, commit policies, resource ownership, or callback lifetimes.

Confirmed failures

On master 776caf18b1c11d1e2f2122e79748521863c0c217, a valid custom container exposing the native apply / visit_and_replace contract had two gaps:

  • Its registered CapabilityPersistence leaf was captured and later bound, but the second, built-in-container-only discovery pass omitted its partition. A real Runtime execution failed with KeyError('custom.note') and INTERNAL_ERROR.
  • Two Trace leaves with distinct native IDs bypassed the existing one-persistence-feature-per-domain validation inside that custom container. A real Runtime initialization incorrectly accepted them.

Change

Reuse the leaves visited by the existing declaration capture. Validate custom persistence participants at capture and derive partitions from the existing captured revision map; validate persistence-domain uniqueness against the same captured leaves, including the default Execution declaration. No new registry, owner, API, or compatibility path.

The original implementation slice changed two files: runtime/_feature_policy.py (+8/-8) and one regression module.

Verification

  • Both failures reproduced independently before their fixes.
  • Final tree 3b02f3ab93825a164c300bb18b63b88739057f77 passed the existing manage.py check linktools-ai entry with a narrow test selection: 18 passed / 13 deselected, architecture and Ruff passed, 17.093 seconds total. Python 3.12, Pydantic AI 2.68.0 / Harness 0.68.0.
  • Coverage includes custom, wrapped-custom, and wrapped-Combined containers; duplicate IDs and duplicate persistence domains; existing native for_agent / for_run callback ownership; completed-run writer sealing for sync and terminal policies; identity bounds.
  • Independent final review found no remaining must-fix issue in this two-file scope. Published tree is identical to the reviewed and tested local tree.
  • Formal CI is separate and pending. No workflow dispatch/rerun, master merge, or deployment performed. This slice does not complete the broader [P2] 梳理 Agent 体系分层与能力实现归属,解耦 Runtime、Task、Evaluation 和 Metrics #230 layering and composition acceptance.

Native container owner documentation

The documentation now traces declaration capture, nested participant identity and revision, run-local binding, native replacements, the original callback retained by accepted writes, and seal/close ownership. The source and existing test definitions were rechecked; documentation-only, no new production behavior. The broader ownership evidence was then completed above. Exact-head natural CI is tracked separately.

Per-resource ownership matrix

domain-composition.md now distinguishes owned and borrowed Persistence, Asset, StepStore, and external SQL resources, including close-failure ownership. This is documentation against current production source and existing test definitions, not additional runtime verification. Exact-head natural CI is tracked separately.

@ice-black-tea
ice-black-tea marked this pull request as ready for review November 15, 2026 01:29
@ice-black-tea
ice-black-tea merged commit 295af64 into master Nov 15, 2026
17 of 30 checks passed
@ice-black-tea
ice-black-tea deleted the fix/custom-capability-discovery-230-20261114 branch November 15, 2026 05:37
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.

1 participant