The conflict in the old cmd/claude-licence-manager/tools_test.go resolves to both sides: main moved it to cmd/manager, and the join's count of binding.changed.<consumer> under its family goes into the moved TestResyncSaysEachOnce. The whole-module test's runtime refused binding.changed.<consumer> because the manifest names the family binding.changed: it now accepts a key that extends a named family by further parts, as A-134 says the event. Builds: design 47 G A-134 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
298 lines
7.0 KiB
JSON
298 lines
7.0 KiB
JSON
{
|
|
"module": "claude-licence-manager",
|
|
"version": "0.1",
|
|
"slug": "licmgr",
|
|
"runs-as": "claude-licence-manager",
|
|
"requires": [
|
|
{
|
|
"name": "licences",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 1
|
|
}
|
|
},
|
|
{
|
|
"name": "bindings",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 8
|
|
}
|
|
},
|
|
{
|
|
"name": "leases",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 1,
|
|
"key-ttl": true
|
|
}
|
|
},
|
|
{
|
|
"name": "offered",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 1,
|
|
"key-ttl": true
|
|
}
|
|
},
|
|
{
|
|
"name": "carried",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 1
|
|
}
|
|
},
|
|
{
|
|
"name": "conditions",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"history": 1
|
|
}
|
|
}
|
|
],
|
|
"logs": [
|
|
{
|
|
"name": "usage",
|
|
"max-age-days": 35,
|
|
"max-mib": 256
|
|
},
|
|
{
|
|
"name": "audit",
|
|
"max-mib": 64
|
|
}
|
|
],
|
|
"own-secrets": {
|
|
"broker": "${dir:state}/broker"
|
|
},
|
|
"secrets-owner": "claude-licence-manager",
|
|
"uses": [
|
|
"operator-channel"
|
|
],
|
|
"invokes": [
|
|
"seat:operator-channel.tell",
|
|
"seat:mesh-vault.licence-put",
|
|
"seat:mesh-vault.get",
|
|
"seat:mesh-config.config",
|
|
"claude-code.claude_code_grant"
|
|
],
|
|
"seats": [
|
|
{
|
|
"name": "anthropic-licence-manager",
|
|
"scope": "mesh",
|
|
"serves": [
|
|
"licences",
|
|
"bindings",
|
|
"bind",
|
|
"switch",
|
|
"release",
|
|
"refresh",
|
|
"usage",
|
|
"adopt",
|
|
"current",
|
|
"public-key"
|
|
]
|
|
}
|
|
],
|
|
"claims": [
|
|
{
|
|
"name": "anthropic-licence-manager",
|
|
"scope": "mesh",
|
|
"serves": [
|
|
"licences",
|
|
"bindings",
|
|
"bind",
|
|
"switch",
|
|
"release",
|
|
"refresh",
|
|
"usage",
|
|
"adopt",
|
|
"current",
|
|
"public-key"
|
|
]
|
|
}
|
|
],
|
|
"emits": [
|
|
"licence.adopted",
|
|
"licence.refused",
|
|
"licence.switched",
|
|
"licence.failing",
|
|
"usage.read",
|
|
"binding.changed",
|
|
"holdings.asked"
|
|
],
|
|
"consumes": [
|
|
"claude-code.holdings-changed"
|
|
],
|
|
"config": {
|
|
"cadence_minutes": {
|
|
"type": "number",
|
|
"description": "How old a licence's grant may grow before it is rotated, in minutes; 0 keeps 240.",
|
|
"minimum": 0,
|
|
"trusted": true,
|
|
"default": 240
|
|
},
|
|
"floor_minutes": {
|
|
"type": "number",
|
|
"description": "How little time a grant may have left before it is refreshed in any case, in minutes; 0 keeps 60.",
|
|
"minimum": 0,
|
|
"trusted": true,
|
|
"default": 60
|
|
},
|
|
"failures_to_notify": {
|
|
"type": "number",
|
|
"description": "How many refreshes of a licence fail in a row before the operator is told, a count; 0 keeps 3.",
|
|
"minimum": 0,
|
|
"trusted": true,
|
|
"default": 3
|
|
},
|
|
"cooldown_hours": {
|
|
"type": "number",
|
|
"description": "How long after telling the operator about a licence nothing more is said about it, in hours; 0 keeps 24.",
|
|
"minimum": 0,
|
|
"trusted": true,
|
|
"default": 24
|
|
},
|
|
"refresh_warn_days": {
|
|
"type": "number",
|
|
"description": "How long before a licence's refresh token itself expires the operator is warned, in days; 0 keeps 3.",
|
|
"minimum": 0,
|
|
"trusted": true,
|
|
"default": 3
|
|
},
|
|
"switch_auto": {
|
|
"type": "boolean",
|
|
"description": "Whether the manager moves every consumer off a licence whose weekly usage reaches switch_at_pct, to the licence with the most room; off, it still raises its no-room and near-limit conditions.",
|
|
"trusted": true,
|
|
"default": true
|
|
},
|
|
"switch_at_pct": {
|
|
"type": "number",
|
|
"description": "The weekly usage of a licence, in percent, at which its consumers are moved to the licence with the most room.",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"trusted": true,
|
|
"default": 99
|
|
},
|
|
"room_below_pct": {
|
|
"type": "number",
|
|
"description": "What the weekly usage of a licence must be below, in percent, for it to be a target of a switch.",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"trusted": true,
|
|
"default": 90
|
|
},
|
|
"warn_at_pct": {
|
|
"type": "number",
|
|
"description": "The weekly usage of a licence with consumers, in percent, at which it is warned about once.",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"trusted": true,
|
|
"default": 90
|
|
},
|
|
"usage_minutes": {
|
|
"type": "number",
|
|
"description": "How often each subscription's usage is read, in minutes.",
|
|
"minimum": 1,
|
|
"maximum": 60,
|
|
"trusted": true,
|
|
"default": 5
|
|
},
|
|
"usage_stale_minutes": {
|
|
"type": "number",
|
|
"description": "How old a subscription's last successful usage reading may grow before its room is not known and it is said, in minutes.",
|
|
"minimum": 5,
|
|
"maximum": 180,
|
|
"trusted": true,
|
|
"default": 15
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"id": "account",
|
|
"type": "user",
|
|
"name": "claude-licence-manager",
|
|
"shell": "/usr/bin/nologin",
|
|
"home": "/var/lib/claude-licence-manager"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "claude-licence-manager",
|
|
"place": ".",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "settings",
|
|
"type": "file",
|
|
"path": "${dir:state}/settings.json",
|
|
"mode": "0600",
|
|
"owner": "claude-licence-manager",
|
|
"takes-config": [
|
|
"cadence_minutes",
|
|
"floor_minutes",
|
|
"failures_to_notify",
|
|
"cooldown_hours",
|
|
"refresh_warn_days",
|
|
"switch_auto",
|
|
"switch_at_pct",
|
|
"room_below_pct",
|
|
"warn_at_pct",
|
|
"usage_minutes",
|
|
"usage_stale_minutes"
|
|
],
|
|
"merge": "json",
|
|
"template": "files/settings.json"
|
|
}
|
|
],
|
|
"tools": [
|
|
"licences_switches",
|
|
"licences_read_usage",
|
|
"licences_switch_now",
|
|
"licences_settings",
|
|
"licences_kept",
|
|
"licences_resync",
|
|
"licences_conditions"
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "manager",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/manager",
|
|
"binary": "claude-licence-manager",
|
|
"loads": [
|
|
"claude-licence-manager"
|
|
],
|
|
"env": {
|
|
"MESH_LICENCE_STATE": "${dir:state}",
|
|
"MESH_LICENCE_SETTINGS": "${dir:state}/settings.json"
|
|
}
|
|
},
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/tools",
|
|
"binary": "claude-licence-manager-tools",
|
|
"loads": [
|
|
"claude-licence-manager-tools"
|
|
]
|
|
},
|
|
{
|
|
"name": "files",
|
|
"kind": "archive",
|
|
"from": "files"
|
|
}
|
|
]
|
|
}
|
|
}
|