feat(schema): consume Contract declarations in agent-metadata, drop devapp hints

The agent-metadata generator now merges each registered Contract final
overlay (cmdcore.SchemaDecl) as the top-precedence contract_final
candidate, so declared tools no longer need hint-file rows for
agent_summary/use_when/avoid_when/examples/safety/interface. Selection
eval fixtures and example execution plans synthesize the same assertions
from the declaration, keeping semantic-eval and example coverage intact.

- devapp hint rows deleted from schema_hints/{metadata,selection}/dev.json
  (connect_status/connect_stop/search_open_platform_docs_rag kept);
  artifact content for all 31 declared leaves is byte-identical, only
  provenance now reads contract_final / cmdcore.SchemaDecl
- exact-coverage gates exempt declared tools (hints remain required for
  every non-declared command); reviewed-delivery gate accepts
  contract_final as the stronger reviewed source
- cmdcore derives effect_source=cmdcore.contract for SchemaDecl-only
  safety (read leaves), matching the Risk-shorthand path

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
玉澜andCursor committed 2026-07-30 20:37:34 +08:00
1 parent 52324e9bc2
commit 9911d8f9c9
14 files changed
+2651 -4233

No files matched your search

@@ -456,6 +456,14 @@ func validateSelectionHintInput(rootPath, hintsDir string, registry commandRegis
for canonical := range registry.CanonicalToolPaths {
expectedTools[canonical] = true
}
// Declared tools carry selection fields in the Contract final overlay
// (cmdcore.SchemaDecl) and are exempt from hint-file coverage.
for canonical := range expectedTools {
bound, ok := registry.Bound.ByCanonical[canonical]
if ok && cli.HasRuntimeContractFinal(bound.PrimaryCommand) {
delete(expectedTools, canonical)
}
}
if err := validateSelectionMetadataSet(agentHints, registry.ProductIDs, expectedTools); err != nil {
return fmt.Errorf("validate selection Agent hints: %w", err)
}