feat(resource): add deferred virtual resource types
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 20s
CI / lint (pull_request) Successful in 23s
CI / typecheck (pull_request) Successful in 45s
CI / quality (pull_request) Successful in 45s
CI / security (pull_request) Successful in 57s
CI / unit_tests (pull_request) Successful in 2m56s
CI / docker (pull_request) Successful in 55s
CI / e2e_tests (pull_request) Successful in 3m59s
CI / integration_tests (pull_request) Successful in 5m36s
CI / coverage (pull_request) Successful in 6m59s
CI / benchmark-regression (pull_request) Successful in 40m39s

Add 3 deferred virtual resource types (remote, submodule, symlink) with
equivalence metadata for physical-to-virtual resource linking.

Depends on: #662 (child_types reference types introduced by #662)

- Type definitions extracted to _resource_registry_virtual_deferred.py
  for consistency with _resource_registry_virtual.py (#329)
- YAML configs with equivalence criteria per spec, spec reference comments
- Bootstrap registration via BUILTIN_TYPES spread, hidden from
  resource add scaffolding (user_addable: false)
- Equivalence structural validation in ResourceTypeSpec model validator:
  criteria must be a non-empty list of non-empty strings; virtual types
  must have sandbox_strategy=none, user_addable=false, handler=None,
  all capabilities false
- Behave tests (52 scenarios), Robot tests (7), ASV benchmarks
- DB roundtrip tests verifying virtual types survive bootstrap persistence
- Negative tests: missing equivalence/name/kind, manual add rejection
  for all 3 virtual types (register_resource guard), invalid criteria
  elements (non-string, empty string)

ISSUES CLOSED: #331
This commit is contained in:
2026-03-10 00:19:59 +00:00
parent 3618bf4f7e
commit 5d6cb099ad
16 changed files with 1534 additions and 16 deletions
+20
View File
@@ -0,0 +1,20 @@
# Spec reference: docs/specification.md ~lines 23705-23719, 24619-24631
schema_version: "1.0"
name: remote
description: "Cross-repo remote identity. Links git-remote resources across different repos that point to the same URL."
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-remote"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria: ["url"]
description: "Two git-remote resources share a remote parent when they point to the same normalized URL."
handler: null
+20
View File
@@ -0,0 +1,20 @@
# Spec reference: docs/specification.md ~lines 23705-23719, 24619-24631
schema_version: "1.0"
name: submodule
description: "Cross-repo submodule identity. Links git-submodule resources across different repos with the same submodule URL and path."
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-submodule"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria: ["url", "path"]
description: "Two git-submodule resources share a submodule parent when they have the same submodule URL and path."
handler: null
+20
View File
@@ -0,0 +1,20 @@
# Spec reference: docs/specification.md ~lines 23705-23719, 24619-24631
schema_version: "1.0"
name: symlink
description: "Cross-layer symlink identity. Links fs-symlink and git-tree-entry (mode 120000) resources with the same name and target."
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["fs-symlink", "git-tree-entry"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria: ["name", "target_path"]
description: "Two physical symlink resources share a symlink parent when they have the same name and target path."
handler: null