feat(resource): add virtual core resource types
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 18s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 29s
CI / typecheck (pull_request) Successful in 42s
CI / security (pull_request) Successful in 52s
CI / unit_tests (pull_request) Successful in 2m51s
CI / integration_tests (pull_request) Successful in 3m27s
CI / docker (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 3m51s
CI / coverage (pull_request) Successful in 6m12s
CI / benchmark-regression (pull_request) Successful in 37m29s

Add 6 built-in virtual resource types (file, directory, commit, branch, tag,
tree) with equivalence metadata for content-hash and git-object identity
matching.

- YAML configs under examples/resource-types/
- Bootstrap registration with virtual types hidden from resource add scaffolding
- Equivalence criteria per spec (content_hash, merkle_hash, git SHA identity)
- Behave tests (83 scenarios), Robot tests, ASV benchmarks
- Documentation in docs/reference/resource_types_builtin.md

ISSUES CLOSED: #329
This commit is contained in:
2026-03-10 00:20:59 +00:00
parent 758dafd8fa
commit c14ce65d61
20 changed files with 1723 additions and 18 deletions
+22
View File
@@ -0,0 +1,22 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: branch
description: "Cross-repo branch identity linking branches with the same name and HEAD"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-branch"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- name
- head_commit_hash
description: "Two physical branches are equivalent when they share the same branch name and HEAD commit hash"
handler: null
+21
View File
@@ -0,0 +1,21 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: commit
description: "Cross-repo commit identity linking commits with the same hash"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-commit"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- commit_hash
description: "Two physical commits are equivalent when they share the same commit hash"
handler: null
+23
View File
@@ -0,0 +1,23 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: directory
description: "Cross-layer directory identity linking equivalent physical directories"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["fs-directory", "git-tree"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- merkle_hash
- name
- permissions
description: "Two physical resources are equivalent when they share the same Merkle hash, name, and permissions"
handler: null
+23
View File
@@ -0,0 +1,23 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: file
description: "Cross-layer file identity linking equivalent physical files"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["fs-file", "git-tree-entry"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- content_hash
- filename
- permissions
description: "Two physical resources are equivalent when they share the same content bytes (SHA-256), filename, and permissions"
handler: null
+22
View File
@@ -0,0 +1,22 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: tag
description: "Cross-repo tag identity linking tags with the same name and target"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-tag"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- name
- target_sha
description: "Two physical tags are equivalent when they share the same tag name and target object"
handler: null
+21
View File
@@ -0,0 +1,21 @@
# Spec reference: docs/specification.md ~lines 10133-10143, 24548-24632
schema_version: "1.0"
name: tree
description: "Cross-repo/cross-commit tree identity linking trees with the same hash"
resource_kind: virtual
sandbox_strategy: none
user_addable: false
built_in: true
cli_args: []
parent_types: []
child_types: ["git-tree"]
capabilities:
read: false
write: false
sandbox: false
checkpoint: false
equivalence:
criteria:
- tree_hash
description: "Two physical tree objects are equivalent when they share the same tree hash"
handler: null