Files
ECC/schemas/install-state.schema.json
T
YuhaoLin2005 95bf86c348 Add config-health monitor and install wiring
- Add the config-health skill: a read-only monitor for hook wiring, rule references, and rule staleness; every mode exits 0.
- Ship its own SessionStart hook asset so installing the module registers the monitor; keep PreToolUse opt-in.
- Keep one install-state record per hook source, so hooks-runtime and config-health can share settings.json and uninstall removes both.
- Split the monitor into a CLI entry plus constants, paths, and scan modules; split scan_command and the hook contract suite. All files are under 800 lines and no function body reaches 50 lines.
2026-11-02 22:53:30 +08:00

299 lines
6.5 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ECC install state",
"type": "object",
"additionalProperties": false,
"required": [
"schemaVersion",
"installedAt",
"target",
"request",
"resolution",
"source",
"operations"
],
"properties": {
"schemaVersion": {
"type": "string",
"const": "ecc.install.v1"
},
"installedAt": {
"type": "string",
"minLength": 1
},
"lastValidatedAt": {
"type": "string",
"minLength": 1
},
"target": {
"type": "object",
"additionalProperties": false,
"required": [
"id",
"root",
"installStatePath"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"target": {
"type": "string",
"minLength": 1
},
"kind": {
"type": "string",
"enum": [
"home",
"project"
]
},
"root": {
"type": "string",
"minLength": 1
},
"installStatePath": {
"type": "string",
"minLength": 1
}
}
},
"request": {
"type": "object",
"additionalProperties": false,
"required": [
"profile",
"modules",
"includeComponents",
"excludeComponents",
"legacyLanguages",
"legacyMode"
],
"properties": {
"profile": {
"type": [
"string",
"null"
]
},
"modules": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"includeComponents": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"excludeComponents": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"legacyLanguages": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"legacyMode": {
"type": "boolean"
},
"hookConsent": {
"enum": [
"enabled",
"declined",
null
]
}
}
},
"resolution": {
"type": "object",
"additionalProperties": false,
"required": [
"selectedModules",
"skippedModules"
],
"properties": {
"selectedModules": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"skippedModules": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
}
}
},
"source": {
"type": "object",
"additionalProperties": false,
"required": [
"repoVersion",
"repoCommit",
"manifestVersion"
],
"properties": {
"repoVersion": {
"type": [
"string",
"null"
]
},
"repoCommit": {
"type": [
"string",
"null"
]
},
"manifestVersion": {
"type": "integer",
"minimum": 1
}
}
},
"operations": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true,
"required": [
"kind",
"moduleId",
"sourceRelativePath",
"destinationPath",
"strategy",
"ownership",
"scaffoldOnly"
],
"properties": {
"kind": {
"type": "string",
"minLength": 1
},
"moduleId": {
"type": "string",
"minLength": 1
},
"sourceRelativePath": {
"type": "string",
"minLength": 1
},
"destinationPath": {
"type": "string",
"minLength": 1
},
"strategy": {
"type": "string",
"minLength": 1
},
"ownership": {
"type": "string",
"minLength": 1
},
"scaffoldOnly": {
"type": "boolean"
},
"contentSha256": {
"type": "string",
"pattern": "^[a-fA-F0-9]{64}$"
},
"managedHooks": {
"type": "object",
"minProperties": 1,
"propertyNames": {
"type": "string",
"pattern": "\\S"
},
"additionalProperties": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "hooks"],
"properties": {
"id": {
"type": "string",
"pattern": "\\S"
}
}
}
}
}
},
"allOf": [
{
"if": {
"properties": {
"kind": { "const": "update-claude-settings" }
}
},
"then": {
"required": ["managedHooks"],
"anyOf": [
{
"properties": {
"moduleId": { "const": "hooks-runtime" },
"sourceRelativePath": { "const": "hooks/hooks.json" }
}
},
{
"properties": {
"moduleId": { "const": "config-health" },
"sourceRelativePath": {
"const": "manifests/install-assets/config-health-hooks.json"
}
}
}
]
}
}
]
}
}
},
"allOf": [
{
"if": {
"properties": {
"operations": {
"contains": {
"type": "object",
"properties": {
"kind": { "const": "update-claude-settings" }
},
"required": ["kind"]
}
}
}
},
"then": {
"properties": {
"target": {
"properties": {
"target": { "enum": ["claude", "claude-project"] }
},
"required": ["target"]
}
}
}
}
]
}