== 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.
51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
# Check command surface for drift.
|
|
#
|
|
# 硬门禁:校验内嵌 schema_catalog.json 的封闭结构(字段白名单 + 枚举值 +
|
|
# 交叉一致性),由 internal/cli/schema_catalog_structure.go 的
|
|
# TestEmbeddedSchemaCatalogStructure 实现。该门禁确保任何写入 catalog 的代码
|
|
# 路径都不会产出结构非法的工具条目。
|
|
|
|
ROOT="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
|
|
BIN="${DWS_BIN:-$ROOT/dws}"
|
|
|
|
STRICT=0
|
|
if [ "${1:-}" = "--strict" ]; then
|
|
STRICT=1
|
|
fi
|
|
|
|
cd "$ROOT"
|
|
|
|
if [ ! -x "$BIN" ]; then
|
|
printf 'error: dws binary not found at %s (run make build first)\n' "$BIN" >&2
|
|
exit 2
|
|
fi
|
|
|
|
# 硬门禁:内嵌 schema_catalog.json 封闭结构校验。
|
|
if ! go test ./internal/cli -run '^TestEmbeddedSchemaCatalogStructure$' -count=1; then
|
|
printf 'embedded schema catalog structure check: FAILED\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
# These utility commands are stable across the current open-source CLI shape.
|
|
EXPECTED_COMMANDS="auth cache completion version"
|
|
missing=0
|
|
for cmd in $EXPECTED_COMMANDS; do
|
|
# Use `help <command>` so hidden commands are also validated.
|
|
if ! "$BIN" help "$cmd" >/dev/null 2>&1; then
|
|
printf 'missing command: %s\n' "$cmd" >&2
|
|
missing=$((missing + 1))
|
|
fi
|
|
done
|
|
|
|
# Full Schema canonical/primary/alias delivery is exercised once by
|
|
# check-schema-binary.sh. Keep this check focused on the basic command tree.
|
|
if [ "$STRICT" -eq 1 ] && [ "$missing" -gt 0 ]; then
|
|
printf 'command surface check: %d missing commands\n' "$missing" >&2
|
|
exit 1
|
|
fi
|
|
|
|
printf 'command surface check: ok\n'
|