feat: declarative LeafSpec command framework + schema generation/consumption separation
== LeafSpec command framework (internal/helpers/leaf.go) ==
Declarative command construction: LeafSpec/LeafFlag/NewLeafCommand with
Call (pluggable dispatch), LeafInt, PostMount, Trim, Validate. Collapses
per-command hand-written required validation, alias/env fallback, value
transform, and toolArgs assembly into one declarative path.
== devapp migration (28/31 commands) ==
All MCP-direct devapp leaf commands migrated to LeafSpec. Factories
(devAppCall/devAppCallCursor/devAppMeta) fold 33 repeated closures.
fakeDevAppRunner asserts toolArgs for every migrated command. 4 complex
commands (delete/robot submit/result/config) kept hand-written.
== Schema generation/consumption separation ==
- gen.go: isolated //go:generate pragmas from business code.
- command_meta.go: ResolveMeta(cliPath) -> CommandMeta{Identity,Safety,Selection}.
- command_safety.go: SafetyForCLIPath + RenderSafetyAnnotation; safety metadata
flows from embedded catalog into --help output.
- calendar.go HelpFunc fix: delegates to root HelpFunc at help-time.
- schema_catalog_structure.go: closed catalog structure validation gate.
== Registry + catalog per-product sharding ==
schema_command_registry and schema_catalog split into per-product shards,
eliminating concurrent-PR merge conflicts on these files.
== MCP metadata refresh tool ==
cmd/fetch_mcp_metadata: iterates 26 MCP server endpoints, merges with previous
data for cross-server interface_ref. make fetch-mcp-metadata target.
== AGENTS.md ==
Documents the generation/consumption split.
Verified: make policy exit 0, drift zero, all tests pass.
This commit is contained in:
1 parent
e69a1084a7
commit
51dc237d8a
83 files changed
+447387
-444470
No files matched your search
@@ -173,19 +173,19 @@ func TestCrossPlatformCoverageValidateRejectsHardLinkToProtectedDirectoryMember(
|
||||
|
||||
func TestCrossPlatformCoverageValidateRepoTargetAllowlist(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
allowed := filepath.Join(root, "internal/cli/schema_catalog.json")
|
||||
allowed := filepath.Join(root, "internal/cli/schema_catalog")
|
||||
if err := os.MkdirAll(filepath.Dir(allowed), 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: allowed}, "internal/cli/schema_catalog.json"); err != nil {
|
||||
if err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: allowed}, "internal/cli/schema_catalog"); err != nil {
|
||||
t.Fatalf("canonical output rejected: %v", err)
|
||||
}
|
||||
err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: filepath.Join(root, "skills/mono/SKILL.md")}, "internal/cli/schema_catalog.json")
|
||||
err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: filepath.Join(root, "skills/mono/SKILL.md")}, "internal/cli/schema_catalog")
|
||||
if err == nil || !strings.Contains(err.Error(), "not a canonical generated delivery target") {
|
||||
t.Fatalf("repository source output error = %v", err)
|
||||
}
|
||||
outside := filepath.Join(t.TempDir(), "catalog.json")
|
||||
if err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: outside}, "internal/cli/schema_catalog.json"); err != nil {
|
||||
if err := ValidateRepoTargetAllowlist(root, Target{Name: "--output", Path: outside}, "internal/cli/schema_catalog"); err != nil {
|
||||
t.Fatalf("external temporary output rejected: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user