Phase 3 of identity-deregistry. BuildEffectiveCommandRegistry now builds the EffectiveCommandRegistry from CollectIdentitySpecs(root) instead of the embedded reviewed registry, and the registry source is removed atomically: - delete internal/cli/schema_command_registry/ (registry.json + products/), schema_command_registry.schema.json, the three //go:embed directives, and the registry-only loaders/validators (loadReviewedCommandRegistry, decodeCommandRegistry, ValidateCommandRegistrySource, shard assemble/merge helpers, ReviewedCommandRegistryMergedJSON/SourceHash, ReviewedCommandSpecs) - keep CommandSpec/CommandRegistry/EffectiveCommandRegistry, newEffectiveCommandRegistry/indexCommandSpecs, and SourceHash; the collector-built effective hash is byte-identical to the reviewed one, so catalog surface_hash/source_hash are unchanged - convert the Phase 2 dual-run gate into TestCollectedIdentityIsValidSingleSource: collected specs non-empty, no missing primaries, effective build succeeds, SourceHash stable across repeated collection walks - generators: catalog -surface and agent-metadata -registry/-surface become fail-closed retired valves; outputguard no longer protects the registry paths; fetch_mcp_metadata derives interface refs from collected identity instead of the merged registry JSON - retire scripts/policy/check-schema-command-registry.sh and its Makefile invocation; generate-schema/check-generated-drift now fail closed if schema_command_registry/ reappears - update AGENTS.md, docs/reference.md, and in-code reviewed-input notes
41 lines
2.0 KiB
Go
41 lines
2.0 KiB
Go
// Copyright 2026 Alibaba Group
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// gen.go isolates //go:generate pragmas from business code.
|
|
//
|
|
// Schema Catalog delivery is NOT generated here. Production assembles Catalog
|
|
// at runtime via ResolveSchemaBuild (声明即 Catalog); see schema_source_root.go
|
|
// and internal/app/schema_source_register.go. cmd_schema_catalog remains a
|
|
// CI/determinism tool (make generate-schema / check-generated-drift) and must
|
|
// not be a committed delivery step.
|
|
//
|
|
// Inputs consumed by runtime assembly:
|
|
// 1. leaf ContractFinal.Identity identity (canonical/aliases/navigation),
|
|
// collected from the live Cobra tree
|
|
// 2. contract.ProductDecl + leaf ContractFinal Agent routing / selection prose
|
|
// 3. schema_mcp_metadata.json MCP server tool definitions
|
|
// 4. schema_parameter_mapping_ledger.go mapping exclusions / removals (Go)
|
|
// (active bindings retired; ParamDecl.Property owns delivery)
|
|
// 5. param_concepts.json + schema reviewed parameter synonym policy
|
|
// 6. cobra command tree (Go runtime) flags/usage/required (reflected)
|
|
//
|
|
// schema_hints/, schema_agent_metadata/, and schema_command_registry/ are
|
|
// retired.
|
|
//
|
|
// Remaining generated output from this file:
|
|
// - param_aliases_generated.go per-command parameter normalization
|
|
|
|
package cli
|
|
|
|
//go:generate go run ../generator/cmd_param_aliases -root ../.. -output param_aliases_generated.go
|