ai-execution-protocol 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -1
- package/README.md +15 -2
- package/dist/minimal/AGENTS.md +5 -1
- package/dist/minimal/canonical-state.yaml +1 -1
- package/dist/minimal/capabilities/registry.yaml +48 -0
- package/dist/minimal/context-map.yaml +2 -1
- package/dist/minimal/memory/INDEX.yaml +1 -1
- package/dist/minimal/protocol/README.yaml +3 -1
- package/dist/minimal/protocol/capability-router.yaml +123 -0
- package/dist/minimal/protocol/fast-path.yaml +3 -1
- package/dist/minimal/protocol/route-packs.yaml +12 -1
- package/dist/minimal/protocol/router.yaml +8 -1
- package/install-manifest.json +13 -2
- package/package.json +1 -1
- package/protocol/README.yaml +3 -1
- package/protocol/capability-router.yaml +123 -0
- package/protocol/fast-path.yaml +3 -1
- package/protocol/route-packs.yaml +12 -1
- package/protocol/router.yaml +8 -1
- package/scripts/README.md +33 -1
- package/templates/minimal/AGENTS.md +5 -1
- package/templates/minimal/canonical-state.yaml +1 -1
- package/templates/minimal/capabilities/registry.yaml +48 -0
- package/templates/minimal/context-map.yaml +2 -1
- package/templates/minimal/memory/INDEX.yaml +1 -1
package/AGENTS.md
CHANGED
|
@@ -27,7 +27,9 @@ metodologia. Para executar tarefas, prefira as regras curtas em `protocol/`.
|
|
|
27
27
|
3. `protocol/route-packs.yaml` para ler o resumo compacto da rota.
|
|
28
28
|
4. `protocol/context-budget.yaml` para limitar a leitura inicial.
|
|
29
29
|
5. `memory/INDEX.yaml` somente quando memoria puder ajudar.
|
|
30
|
-
6.
|
|
30
|
+
6. `protocol/capability-router.yaml` quando skills, MCPs ou ferramentas
|
|
31
|
+
opcionais puderem ser necessarios.
|
|
32
|
+
7. Arquivo YAML especifico em `protocol/` somente quando o pack nao bastar:
|
|
31
33
|
- `README.yaml`
|
|
32
34
|
- `modes.yaml`
|
|
33
35
|
- `execution-rules.yaml`
|
|
@@ -38,6 +40,7 @@ metodologia. Para executar tarefas, prefira as regras curtas em `protocol/`.
|
|
|
38
40
|
- `context-compiler.yaml`
|
|
39
41
|
- `context-budget.yaml`
|
|
40
42
|
- `adaptive-memory.yaml`
|
|
43
|
+
- `capability-router.yaml`
|
|
41
44
|
- `selective-validation.yaml`
|
|
42
45
|
- `route-packs.yaml`
|
|
43
46
|
- `formatting-rules.yaml`
|
|
@@ -63,6 +66,8 @@ metodologia. Para executar tarefas, prefira as regras curtas em `protocol/`.
|
|
|
63
66
|
- Leia apenas os arquivos indicados por `protocol/router.yaml`.
|
|
64
67
|
- Use `protocol/route-packs.yaml` antes de abrir todos os arquivos da rota.
|
|
65
68
|
- Respeite `protocol/context-budget.yaml` e justifique expansao.
|
|
69
|
+
- Use `protocol/capability-router.yaml` antes de carregar skills, MCPs ou
|
|
70
|
+
ferramentas opcionais.
|
|
66
71
|
- Leia apenas assuntos de memoria relacionados ao pedido.
|
|
67
72
|
- Ao terminar, registre `updated`, `unchanged`, `candidate`, `replaced` ou
|
|
68
73
|
`blocked_sensitive`.
|
|
@@ -76,6 +81,8 @@ metodologia. Para executar tarefas, prefira as regras curtas em `protocol/`.
|
|
|
76
81
|
prefira micro formato legivel com `PO`, `PM` e `OK`.
|
|
77
82
|
- Ao criar feature, refatoracao grande ou tarefa critica, use
|
|
78
83
|
`protocol/spec-driven.yaml` sem transformar tarefa simples em spec pesada.
|
|
84
|
+
- Selecione apenas capacidades necessarias para cobrir resultado e validacao.
|
|
85
|
+
Risco maior restringe permissao; nao aumenta ferramentas por padrao.
|
|
79
86
|
- Nao edite arquivo que nao foi identificado como candidato.
|
|
80
87
|
- Se o risco subir, atualize a classificacao antes de continuar.
|
|
81
88
|
- Para nivel critico, peca confirmacao antes de acao sensivel.
|
package/README.md
CHANGED
|
@@ -31,8 +31,8 @@ O protocolo nao tenta transformar toda tarefa em um processo pesado. A regra e
|
|
|
31
31
|
proporcionalidade: tarefa simples deve ser rapida; tarefa critica exige mais
|
|
32
32
|
mapa, confirmacao e evidencia.
|
|
33
33
|
|
|
34
|
-
Na v0.3.
|
|
35
|
-
|
|
34
|
+
Na v0.3.1, o framework combina memoria adaptativa, orcamento de contexto,
|
|
35
|
+
validacao seletiva e roteamento de capacidades:
|
|
36
36
|
|
|
37
37
|
```text
|
|
38
38
|
pedido -> risco -> memoria relevante -> contexto limitado -> acao -> validacao
|
|
@@ -42,6 +42,15 @@ Memoria orienta, o pedido atual autoriza e arquivos verificados definem a
|
|
|
42
42
|
realidade. Inferencias ficam candidatas ate acumularem evidencia, e conteudo
|
|
43
43
|
sensivel e bloqueado.
|
|
44
44
|
|
|
45
|
+
Skills, MCPs e ferramentas opcionais seguem outro limite:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
resultado necessario -> capacidade minima -> permissao -> validacao
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Risco maior restringe permissoes. Ele nao aumenta automaticamente a quantidade
|
|
52
|
+
de ferramentas.
|
|
53
|
+
|
|
45
54
|
## Status
|
|
46
55
|
|
|
47
56
|
Projeto em fase de pesquisa e evolucao.
|
|
@@ -60,6 +69,7 @@ continuam obrigatorios em tarefas criticas.
|
|
|
60
69
|
- `decisions/`: decisoes importantes com status.
|
|
61
70
|
- `memory/`: preferencias, estado e padroes duraveis validados.
|
|
62
71
|
- `candidate-memory/`: inferencias ainda nao autoritativas.
|
|
72
|
+
- `capabilities/`: registro pequeno de skills, MCPs e ferramentas conhecidas.
|
|
63
73
|
- `docs/`: explicacoes conceituais em Markdown.
|
|
64
74
|
- `protocol/`: regras operacionais curtas em YAML.
|
|
65
75
|
- `protocol/route-packs.yaml`: resumos compactos para reduzir leitura por rota.
|
|
@@ -87,6 +97,7 @@ continuam obrigatorios em tarefas criticas.
|
|
|
87
97
|
8. Abra arquivos completos apenas quando o resumo compacto nao bastar.
|
|
88
98
|
9. Execute, valide e entregue com evidencia.
|
|
89
99
|
10. Atualize memoria apenas quando surgir um fato duravel e seguro.
|
|
100
|
+
11. Carregue apenas capacidades necessarias para resultado e validacao.
|
|
90
101
|
|
|
91
102
|
Regra de seguranca:
|
|
92
103
|
|
|
@@ -113,6 +124,7 @@ Comece por:
|
|
|
113
124
|
- `docs/18-memoria-adaptativa.md`
|
|
114
125
|
- `docs/19-orcamento-de-contexto.md`
|
|
115
126
|
- `docs/20-validacao-seletiva.md`
|
|
127
|
+
- `docs/21-roteamento-de-capacidades.md`
|
|
116
128
|
|
|
117
129
|
Use `docs/` para entender a metodologia. Use `protocol/` quando quiser aplicar
|
|
118
130
|
as regras em uma tarefa real.
|
|
@@ -142,6 +154,7 @@ Valide a memoria e selecione apenas as verificacoes necessarias:
|
|
|
142
154
|
```powershell
|
|
143
155
|
python scripts/memory_manager.py --root . validate
|
|
144
156
|
python scripts/selective_validation.py
|
|
157
|
+
python scripts/capability_router.py --risk 1 --operation read --tag code_search
|
|
145
158
|
```
|
|
146
159
|
|
|
147
160
|
## Instalacao em outro projeto
|
package/dist/minimal/AGENTS.md
CHANGED
|
@@ -16,12 +16,16 @@ entrega.
|
|
|
16
16
|
2. `protocol/router.yaml`
|
|
17
17
|
3. `protocol/route-packs.yaml`
|
|
18
18
|
4. `memory/INDEX.yaml` somente quando memoria puder ajudar
|
|
19
|
-
5.
|
|
19
|
+
5. `capabilities/registry.yaml` somente quando a tarefa exigir ferramenta
|
|
20
|
+
6. YAML completo da rota somente quando o pack nao bastar
|
|
20
21
|
|
|
21
22
|
## Regras de execucao
|
|
22
23
|
|
|
23
24
|
- Classifique o risco antes de agir.
|
|
24
25
|
- Use o menor contexto suficiente e respeite `protocol/context-budget.yaml`.
|
|
26
|
+
- Use `protocol/capability-router.yaml` para carregar somente skills, MCPs e
|
|
27
|
+
ferramentas necessarias.
|
|
28
|
+
- Risco maior restringe permissao; nao aumenta a quantidade por padrao.
|
|
25
29
|
- Memoria orienta; pedido atual autoriza; codigo verificado define realidade.
|
|
26
30
|
- Nunca amplie escopo com base em previsao ou preferencia antiga.
|
|
27
31
|
- Use `protocol/selective-validation.yaml` para escolher a menor prova suficiente.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
id: capability_registry
|
|
2
|
+
type: capability_registry
|
|
3
|
+
version: 0.3.1
|
|
4
|
+
purpose: project_capabilities_available_to_the_agent
|
|
5
|
+
policy:
|
|
6
|
+
default_available: false
|
|
7
|
+
runtime_availability_must_be_verified: true
|
|
8
|
+
capabilities:
|
|
9
|
+
- id: local_search
|
|
10
|
+
type: local_tool
|
|
11
|
+
available: true
|
|
12
|
+
tags: [code_search, file_discovery]
|
|
13
|
+
operations: [read]
|
|
14
|
+
cost: {tokens: low, latency: low}
|
|
15
|
+
side_effect: none
|
|
16
|
+
confirmation: never
|
|
17
|
+
- id: local_files
|
|
18
|
+
type: local_tool
|
|
19
|
+
available: true
|
|
20
|
+
tags: [file_read, file_write]
|
|
21
|
+
operations: [read, write]
|
|
22
|
+
cost: {tokens: low, latency: low}
|
|
23
|
+
side_effect: local_write
|
|
24
|
+
confirmation: risk_based
|
|
25
|
+
- id: focused_skill
|
|
26
|
+
type: skill
|
|
27
|
+
available: runtime
|
|
28
|
+
tags: [domain_guidance]
|
|
29
|
+
operations: [read]
|
|
30
|
+
cost: {tokens: medium, latency: low}
|
|
31
|
+
side_effect: none
|
|
32
|
+
confirmation: never
|
|
33
|
+
- id: targeted_mcp
|
|
34
|
+
type: mcp
|
|
35
|
+
available: runtime
|
|
36
|
+
tags: [external_context, remote_operation]
|
|
37
|
+
operations: [read, write]
|
|
38
|
+
cost: {tokens: medium, latency: medium}
|
|
39
|
+
side_effect: remote_write
|
|
40
|
+
confirmation: operation_based
|
|
41
|
+
- id: publish_service
|
|
42
|
+
type: remote_service
|
|
43
|
+
available: runtime
|
|
44
|
+
tags: [publish]
|
|
45
|
+
operations: [publish]
|
|
46
|
+
cost: {tokens: low, latency: medium}
|
|
47
|
+
side_effect: publish
|
|
48
|
+
confirmation: always
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: project_context_map
|
|
2
2
|
type: context_map
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: small_index_for_progressive_context_retrieval
|
|
5
5
|
maintenance:
|
|
6
6
|
current_mode: manual_bootstrap
|
|
@@ -11,6 +11,7 @@ read_first:
|
|
|
11
11
|
- protocol/router.yaml
|
|
12
12
|
- protocol/route-packs.yaml
|
|
13
13
|
- memory/INDEX.yaml
|
|
14
|
+
- capabilities/registry.yaml
|
|
14
15
|
domains: {}
|
|
15
16
|
retrieval_policy:
|
|
16
17
|
order:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
id: protocol_index
|
|
2
2
|
type: index
|
|
3
3
|
format: yaml
|
|
4
|
-
protocol_version: 0.3.
|
|
4
|
+
protocol_version: 0.3.1
|
|
5
5
|
purpose: ai_operational_rules
|
|
6
6
|
source_docs: ../docs
|
|
7
7
|
constraints:
|
|
@@ -37,6 +37,8 @@ files:
|
|
|
37
37
|
purpose: progressive_context_retrieval_with_aliases
|
|
38
38
|
- path: adaptive-memory.yaml
|
|
39
39
|
purpose: maintain_verified_user_and_project_memory
|
|
40
|
+
- path: capability-router.yaml
|
|
41
|
+
purpose: select_minimum_skills_mcps_and_tools_by_value_cost_and_risk
|
|
40
42
|
- path: formatting-rules.yaml
|
|
41
43
|
purpose: ai_readable_file_format
|
|
42
44
|
- path: prompt-economy.yaml
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
id: capability_router
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.3.1
|
|
4
|
+
purpose: select_only_necessary_skills_mcps_and_tools
|
|
5
|
+
principle: minimum_capability_set_must_preserve_required_quality
|
|
6
|
+
platform_boundary:
|
|
7
|
+
can_control:
|
|
8
|
+
- selection
|
|
9
|
+
- instruction_loading
|
|
10
|
+
- invocation
|
|
11
|
+
- operation_scope
|
|
12
|
+
cannot_guarantee:
|
|
13
|
+
- physical_unloading_of_host_exposed_tools
|
|
14
|
+
- revocation_of_platform_permissions
|
|
15
|
+
rule: exposed_capability_must_remain_unused_until_selected
|
|
16
|
+
entrypoint:
|
|
17
|
+
registry: capabilities/registry.yaml
|
|
18
|
+
selection_flow:
|
|
19
|
+
- classify_task_and_risk
|
|
20
|
+
- define_required_outcomes_and_operations
|
|
21
|
+
- inspect_available_capability_metadata
|
|
22
|
+
- prefer_existing_local_capability
|
|
23
|
+
- select_smallest_set_covering_required_outcomes
|
|
24
|
+
- add_dependency_only_when_selected_capability_requires_it
|
|
25
|
+
- verify_permissions_confirmation_and_validation
|
|
26
|
+
- stop_discovery_when_coverage_is_complete
|
|
27
|
+
capability_types:
|
|
28
|
+
- built_in_reasoning
|
|
29
|
+
- local_tool
|
|
30
|
+
- skill
|
|
31
|
+
- mcp
|
|
32
|
+
- remote_service
|
|
33
|
+
operations:
|
|
34
|
+
read:
|
|
35
|
+
effect: none_or_read_only
|
|
36
|
+
write:
|
|
37
|
+
effect: state_change
|
|
38
|
+
publish:
|
|
39
|
+
effect: external_release
|
|
40
|
+
destructive:
|
|
41
|
+
effect: irreversible_or_high_impact
|
|
42
|
+
risk_policy:
|
|
43
|
+
level_0:
|
|
44
|
+
external_capability_budget: 0
|
|
45
|
+
allow:
|
|
46
|
+
- built_in_reasoning
|
|
47
|
+
expand_when:
|
|
48
|
+
- direct_answer_requires_verified_current_data
|
|
49
|
+
level_1:
|
|
50
|
+
external_capability_budget: 1
|
|
51
|
+
prefer:
|
|
52
|
+
- local_read
|
|
53
|
+
- focused_skill
|
|
54
|
+
level_2:
|
|
55
|
+
external_capability_budget: 3
|
|
56
|
+
prefer:
|
|
57
|
+
- specialized_skill
|
|
58
|
+
- targeted_mcp
|
|
59
|
+
- local_validation
|
|
60
|
+
level_3:
|
|
61
|
+
external_capability_budget: 3
|
|
62
|
+
principle: higher_risk_means_stricter_permissions_not_more_tools
|
|
63
|
+
require:
|
|
64
|
+
- least_privilege
|
|
65
|
+
- explicit_operation_scope
|
|
66
|
+
- confirmation_before_sensitive_write_publish_or_destructive
|
|
67
|
+
- validation_before_and_after
|
|
68
|
+
cost_model:
|
|
69
|
+
dimensions:
|
|
70
|
+
- context_tokens
|
|
71
|
+
- latency
|
|
72
|
+
- remote_calls
|
|
73
|
+
- permission_scope
|
|
74
|
+
- side_effect_risk
|
|
75
|
+
choose_when:
|
|
76
|
+
- required_outcome_is_covered
|
|
77
|
+
- expected_quality_gain_exceeds_incremental_cost
|
|
78
|
+
never_trade:
|
|
79
|
+
- correctness
|
|
80
|
+
- security
|
|
81
|
+
- required_validation
|
|
82
|
+
- current_information_when_task_depends_on_it
|
|
83
|
+
preference_order:
|
|
84
|
+
- built_in_reasoning
|
|
85
|
+
- existing_project_context
|
|
86
|
+
- local_read_tool
|
|
87
|
+
- focused_local_skill
|
|
88
|
+
- targeted_remote_read
|
|
89
|
+
- remote_write
|
|
90
|
+
- publish_or_destructive
|
|
91
|
+
discovery:
|
|
92
|
+
do:
|
|
93
|
+
- use_known_available_capabilities_first
|
|
94
|
+
- search_for_tool_only_when_required_capability_is_missing
|
|
95
|
+
- load_skill_instructions_only_after_selection
|
|
96
|
+
- connect_mcp_only_for_matching_operation
|
|
97
|
+
avoid:
|
|
98
|
+
- loading_all_skills_before_selection
|
|
99
|
+
- listing_all_mcp_resources_without_need
|
|
100
|
+
- installing_adjacent_tools_not_required_by_task
|
|
101
|
+
- continuing_discovery_after_complete_coverage
|
|
102
|
+
permission_policy:
|
|
103
|
+
- read_permission_does_not_imply_write_permission
|
|
104
|
+
- write_permission_does_not_imply_publish_permission
|
|
105
|
+
- memory_never_authorizes_sensitive_operation
|
|
106
|
+
- capability_availability_does_not_authorize_use
|
|
107
|
+
- current_user_request_defines_allowed_scope
|
|
108
|
+
fallback:
|
|
109
|
+
when_required_coverage_is_missing:
|
|
110
|
+
- do_not_execute_incomplete_high_risk_workflow
|
|
111
|
+
- use_safe_local_partial_work_when_independently_valid
|
|
112
|
+
- report_missing_capability
|
|
113
|
+
- request_installation_or_user_action_only_when_required
|
|
114
|
+
delivery:
|
|
115
|
+
include_when_capability_used:
|
|
116
|
+
- selected_capabilities
|
|
117
|
+
- selection_reason
|
|
118
|
+
- operation_scope
|
|
119
|
+
- confirmation_status_when_required
|
|
120
|
+
- validation
|
|
121
|
+
omit:
|
|
122
|
+
- full_available_capability_catalog
|
|
123
|
+
- rejected_capabilities_without_audit_need
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
id: fast_path
|
|
2
2
|
type: agent_entrypoint
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: minimum_rules_to_start_any_task
|
|
5
5
|
read_next:
|
|
6
6
|
- router.yaml
|
|
7
7
|
- route-packs.yaml
|
|
8
8
|
- context-budget.yaml
|
|
9
|
+
- capability-router.yaml
|
|
9
10
|
- modes.yaml
|
|
10
11
|
core_rules:
|
|
11
12
|
- classify_risk_before_action
|
|
@@ -24,6 +25,7 @@ core_rules:
|
|
|
24
25
|
- use_only_matching_memory_subjects
|
|
25
26
|
- check_memory_update_result_after_task
|
|
26
27
|
- use_selective_validation_by_blast_radius
|
|
28
|
+
- select_minimum_capability_set_before_loading_skills_or_mcps
|
|
27
29
|
risk_short:
|
|
28
30
|
level_0: answer_only
|
|
29
31
|
level_1: small_clear_reversible_isolated_change
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: route_packs
|
|
2
2
|
type: route_summary_index
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: compact_first_read_before_full_route_files
|
|
5
5
|
principle: read_pack_first_expand_only_when_needed
|
|
6
6
|
use:
|
|
@@ -182,3 +182,14 @@ packs:
|
|
|
182
182
|
- infer_checks_from_changed_files
|
|
183
183
|
- run_smallest_sufficient_validation
|
|
184
184
|
- expand_when_shared_contract_changes
|
|
185
|
+
capability_selection:
|
|
186
|
+
risk: adaptive
|
|
187
|
+
read_if_pack_insufficient:
|
|
188
|
+
- capability-router.yaml
|
|
189
|
+
- context-budget.yaml
|
|
190
|
+
do:
|
|
191
|
+
- define_required_outcomes_and_operations
|
|
192
|
+
- select_smallest_available_capability_set
|
|
193
|
+
- load_only_selected_skill_or_mcp
|
|
194
|
+
- require_confirmation_for_sensitive_remote_effect
|
|
195
|
+
- stop_discovery_when_quality_coverage_is_complete
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: protocol_router
|
|
2
2
|
type: read_router
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: choose_minimum_protocol_files_by_task
|
|
5
5
|
default_read:
|
|
6
6
|
- fast-path.yaml
|
|
@@ -113,6 +113,12 @@ routes:
|
|
|
113
113
|
read:
|
|
114
114
|
- fast-path.yaml
|
|
115
115
|
- selective-validation.yaml
|
|
116
|
+
capability_selection:
|
|
117
|
+
risk: adaptive
|
|
118
|
+
read:
|
|
119
|
+
- fast-path.yaml
|
|
120
|
+
- capability-router.yaml
|
|
121
|
+
- context-budget.yaml
|
|
116
122
|
rules:
|
|
117
123
|
- start_with_default_read
|
|
118
124
|
- choose_one_route_if_task_type_is_clear
|
|
@@ -120,6 +126,7 @@ rules:
|
|
|
120
126
|
- expand_from_route_pack_only_when_needed
|
|
121
127
|
- apply_context_budget_to_selected_route
|
|
122
128
|
- retrieve_only_matching_memory_subjects
|
|
129
|
+
- select_capabilities_before_loading_skill_or_connecting_mcp
|
|
123
130
|
- if_route_unclear_read_risk_levels_then_choose_route
|
|
124
131
|
- do_not_read_docs_unless_protocol_is_insufficient
|
|
125
132
|
- do_not_read_cases_unless_testing_or_comparing_behavior
|
package/install-manifest.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"context-budget.yaml",
|
|
16
16
|
"persistent-context.yaml",
|
|
17
17
|
"adaptive-memory.yaml",
|
|
18
|
+
"capability-router.yaml",
|
|
18
19
|
"formatting-rules.yaml",
|
|
19
20
|
"prompt-economy.yaml",
|
|
20
21
|
"spec-driven.yaml"
|
|
@@ -26,7 +27,8 @@
|
|
|
26
27
|
"context-map.yaml",
|
|
27
28
|
"decisions/README.md",
|
|
28
29
|
"memory/INDEX.yaml",
|
|
29
|
-
"candidate-memory/README.md"
|
|
30
|
+
"candidate-memory/README.md",
|
|
31
|
+
"capabilities/registry.yaml"
|
|
30
32
|
],
|
|
31
33
|
"aiignore_lines": [
|
|
32
34
|
"results/",
|
|
@@ -42,7 +44,8 @@
|
|
|
42
44
|
"protocol/fast-path.yaml",
|
|
43
45
|
"protocol/router.yaml",
|
|
44
46
|
"protocol/route-packs.yaml",
|
|
45
|
-
"Classifique o risco antes de agir"
|
|
47
|
+
"Classifique o risco antes de agir",
|
|
48
|
+
"protocol/capability-router.yaml"
|
|
46
49
|
],
|
|
47
50
|
"memory/INDEX.yaml": [
|
|
48
51
|
"memory_index",
|
|
@@ -59,6 +62,14 @@
|
|
|
59
62
|
"protocol/selective-validation.yaml": [
|
|
60
63
|
"smallest_validation_set",
|
|
61
64
|
"release"
|
|
65
|
+
],
|
|
66
|
+
"protocol/capability-router.yaml": [
|
|
67
|
+
"minimum_capability_set",
|
|
68
|
+
"higher_risk_means_stricter_permissions_not_more_tools"
|
|
69
|
+
],
|
|
70
|
+
"capabilities/registry.yaml": [
|
|
71
|
+
"capability_registry",
|
|
72
|
+
"runtime_availability_must_be_verified"
|
|
62
73
|
]
|
|
63
74
|
}
|
|
64
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-execution-protocol",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Experimental AI execution protocol for safer agent workflows, minimal context, risk classification, validation, and evidence-based delivery.",
|
|
6
6
|
"license": "MIT",
|
package/protocol/README.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
id: protocol_index
|
|
2
2
|
type: index
|
|
3
3
|
format: yaml
|
|
4
|
-
protocol_version: 0.3.
|
|
4
|
+
protocol_version: 0.3.1
|
|
5
5
|
purpose: ai_operational_rules
|
|
6
6
|
source_docs: ../docs
|
|
7
7
|
constraints:
|
|
@@ -37,6 +37,8 @@ files:
|
|
|
37
37
|
purpose: progressive_context_retrieval_with_aliases
|
|
38
38
|
- path: adaptive-memory.yaml
|
|
39
39
|
purpose: maintain_verified_user_and_project_memory
|
|
40
|
+
- path: capability-router.yaml
|
|
41
|
+
purpose: select_minimum_skills_mcps_and_tools_by_value_cost_and_risk
|
|
40
42
|
- path: formatting-rules.yaml
|
|
41
43
|
purpose: ai_readable_file_format
|
|
42
44
|
- path: prompt-economy.yaml
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
id: capability_router
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.3.1
|
|
4
|
+
purpose: select_only_necessary_skills_mcps_and_tools
|
|
5
|
+
principle: minimum_capability_set_must_preserve_required_quality
|
|
6
|
+
platform_boundary:
|
|
7
|
+
can_control:
|
|
8
|
+
- selection
|
|
9
|
+
- instruction_loading
|
|
10
|
+
- invocation
|
|
11
|
+
- operation_scope
|
|
12
|
+
cannot_guarantee:
|
|
13
|
+
- physical_unloading_of_host_exposed_tools
|
|
14
|
+
- revocation_of_platform_permissions
|
|
15
|
+
rule: exposed_capability_must_remain_unused_until_selected
|
|
16
|
+
entrypoint:
|
|
17
|
+
registry: capabilities/registry.yaml
|
|
18
|
+
selection_flow:
|
|
19
|
+
- classify_task_and_risk
|
|
20
|
+
- define_required_outcomes_and_operations
|
|
21
|
+
- inspect_available_capability_metadata
|
|
22
|
+
- prefer_existing_local_capability
|
|
23
|
+
- select_smallest_set_covering_required_outcomes
|
|
24
|
+
- add_dependency_only_when_selected_capability_requires_it
|
|
25
|
+
- verify_permissions_confirmation_and_validation
|
|
26
|
+
- stop_discovery_when_coverage_is_complete
|
|
27
|
+
capability_types:
|
|
28
|
+
- built_in_reasoning
|
|
29
|
+
- local_tool
|
|
30
|
+
- skill
|
|
31
|
+
- mcp
|
|
32
|
+
- remote_service
|
|
33
|
+
operations:
|
|
34
|
+
read:
|
|
35
|
+
effect: none_or_read_only
|
|
36
|
+
write:
|
|
37
|
+
effect: state_change
|
|
38
|
+
publish:
|
|
39
|
+
effect: external_release
|
|
40
|
+
destructive:
|
|
41
|
+
effect: irreversible_or_high_impact
|
|
42
|
+
risk_policy:
|
|
43
|
+
level_0:
|
|
44
|
+
external_capability_budget: 0
|
|
45
|
+
allow:
|
|
46
|
+
- built_in_reasoning
|
|
47
|
+
expand_when:
|
|
48
|
+
- direct_answer_requires_verified_current_data
|
|
49
|
+
level_1:
|
|
50
|
+
external_capability_budget: 1
|
|
51
|
+
prefer:
|
|
52
|
+
- local_read
|
|
53
|
+
- focused_skill
|
|
54
|
+
level_2:
|
|
55
|
+
external_capability_budget: 3
|
|
56
|
+
prefer:
|
|
57
|
+
- specialized_skill
|
|
58
|
+
- targeted_mcp
|
|
59
|
+
- local_validation
|
|
60
|
+
level_3:
|
|
61
|
+
external_capability_budget: 3
|
|
62
|
+
principle: higher_risk_means_stricter_permissions_not_more_tools
|
|
63
|
+
require:
|
|
64
|
+
- least_privilege
|
|
65
|
+
- explicit_operation_scope
|
|
66
|
+
- confirmation_before_sensitive_write_publish_or_destructive
|
|
67
|
+
- validation_before_and_after
|
|
68
|
+
cost_model:
|
|
69
|
+
dimensions:
|
|
70
|
+
- context_tokens
|
|
71
|
+
- latency
|
|
72
|
+
- remote_calls
|
|
73
|
+
- permission_scope
|
|
74
|
+
- side_effect_risk
|
|
75
|
+
choose_when:
|
|
76
|
+
- required_outcome_is_covered
|
|
77
|
+
- expected_quality_gain_exceeds_incremental_cost
|
|
78
|
+
never_trade:
|
|
79
|
+
- correctness
|
|
80
|
+
- security
|
|
81
|
+
- required_validation
|
|
82
|
+
- current_information_when_task_depends_on_it
|
|
83
|
+
preference_order:
|
|
84
|
+
- built_in_reasoning
|
|
85
|
+
- existing_project_context
|
|
86
|
+
- local_read_tool
|
|
87
|
+
- focused_local_skill
|
|
88
|
+
- targeted_remote_read
|
|
89
|
+
- remote_write
|
|
90
|
+
- publish_or_destructive
|
|
91
|
+
discovery:
|
|
92
|
+
do:
|
|
93
|
+
- use_known_available_capabilities_first
|
|
94
|
+
- search_for_tool_only_when_required_capability_is_missing
|
|
95
|
+
- load_skill_instructions_only_after_selection
|
|
96
|
+
- connect_mcp_only_for_matching_operation
|
|
97
|
+
avoid:
|
|
98
|
+
- loading_all_skills_before_selection
|
|
99
|
+
- listing_all_mcp_resources_without_need
|
|
100
|
+
- installing_adjacent_tools_not_required_by_task
|
|
101
|
+
- continuing_discovery_after_complete_coverage
|
|
102
|
+
permission_policy:
|
|
103
|
+
- read_permission_does_not_imply_write_permission
|
|
104
|
+
- write_permission_does_not_imply_publish_permission
|
|
105
|
+
- memory_never_authorizes_sensitive_operation
|
|
106
|
+
- capability_availability_does_not_authorize_use
|
|
107
|
+
- current_user_request_defines_allowed_scope
|
|
108
|
+
fallback:
|
|
109
|
+
when_required_coverage_is_missing:
|
|
110
|
+
- do_not_execute_incomplete_high_risk_workflow
|
|
111
|
+
- use_safe_local_partial_work_when_independently_valid
|
|
112
|
+
- report_missing_capability
|
|
113
|
+
- request_installation_or_user_action_only_when_required
|
|
114
|
+
delivery:
|
|
115
|
+
include_when_capability_used:
|
|
116
|
+
- selected_capabilities
|
|
117
|
+
- selection_reason
|
|
118
|
+
- operation_scope
|
|
119
|
+
- confirmation_status_when_required
|
|
120
|
+
- validation
|
|
121
|
+
omit:
|
|
122
|
+
- full_available_capability_catalog
|
|
123
|
+
- rejected_capabilities_without_audit_need
|
package/protocol/fast-path.yaml
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
id: fast_path
|
|
2
2
|
type: agent_entrypoint
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: minimum_rules_to_start_any_task
|
|
5
5
|
read_next:
|
|
6
6
|
- router.yaml
|
|
7
7
|
- route-packs.yaml
|
|
8
8
|
- context-budget.yaml
|
|
9
|
+
- capability-router.yaml
|
|
9
10
|
- modes.yaml
|
|
10
11
|
core_rules:
|
|
11
12
|
- classify_risk_before_action
|
|
@@ -24,6 +25,7 @@ core_rules:
|
|
|
24
25
|
- use_only_matching_memory_subjects
|
|
25
26
|
- check_memory_update_result_after_task
|
|
26
27
|
- use_selective_validation_by_blast_radius
|
|
28
|
+
- select_minimum_capability_set_before_loading_skills_or_mcps
|
|
27
29
|
risk_short:
|
|
28
30
|
level_0: answer_only
|
|
29
31
|
level_1: small_clear_reversible_isolated_change
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: route_packs
|
|
2
2
|
type: route_summary_index
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: compact_first_read_before_full_route_files
|
|
5
5
|
principle: read_pack_first_expand_only_when_needed
|
|
6
6
|
use:
|
|
@@ -182,3 +182,14 @@ packs:
|
|
|
182
182
|
- infer_checks_from_changed_files
|
|
183
183
|
- run_smallest_sufficient_validation
|
|
184
184
|
- expand_when_shared_contract_changes
|
|
185
|
+
capability_selection:
|
|
186
|
+
risk: adaptive
|
|
187
|
+
read_if_pack_insufficient:
|
|
188
|
+
- capability-router.yaml
|
|
189
|
+
- context-budget.yaml
|
|
190
|
+
do:
|
|
191
|
+
- define_required_outcomes_and_operations
|
|
192
|
+
- select_smallest_available_capability_set
|
|
193
|
+
- load_only_selected_skill_or_mcp
|
|
194
|
+
- require_confirmation_for_sensitive_remote_effect
|
|
195
|
+
- stop_discovery_when_quality_coverage_is_complete
|
package/protocol/router.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: protocol_router
|
|
2
2
|
type: read_router
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: choose_minimum_protocol_files_by_task
|
|
5
5
|
default_read:
|
|
6
6
|
- fast-path.yaml
|
|
@@ -113,6 +113,12 @@ routes:
|
|
|
113
113
|
read:
|
|
114
114
|
- fast-path.yaml
|
|
115
115
|
- selective-validation.yaml
|
|
116
|
+
capability_selection:
|
|
117
|
+
risk: adaptive
|
|
118
|
+
read:
|
|
119
|
+
- fast-path.yaml
|
|
120
|
+
- capability-router.yaml
|
|
121
|
+
- context-budget.yaml
|
|
116
122
|
rules:
|
|
117
123
|
- start_with_default_read
|
|
118
124
|
- choose_one_route_if_task_type_is_clear
|
|
@@ -120,6 +126,7 @@ rules:
|
|
|
120
126
|
- expand_from_route_pack_only_when_needed
|
|
121
127
|
- apply_context_budget_to_selected_route
|
|
122
128
|
- retrieve_only_matching_memory_subjects
|
|
129
|
+
- select_capabilities_before_loading_skill_or_connecting_mcp
|
|
123
130
|
- if_route_unclear_read_risk_levels_then_choose_route
|
|
124
131
|
- do_not_read_docs_unless_protocol_is_insufficient
|
|
125
132
|
- do_not_read_cases_unless_testing_or_comparing_behavior
|
package/scripts/README.md
CHANGED
|
@@ -73,6 +73,20 @@ python scripts/selective_validation.py
|
|
|
73
73
|
python scripts/selective_validation.py --release
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
## capability_router.py
|
|
77
|
+
|
|
78
|
+
Seleciona o menor conjunto de skills, MCPs e ferramentas que cobre a tarefa.
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
python scripts/capability_router.py --risk 1 --operation read --tag code_search
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Capacidades marcadas como `runtime` precisam ser informadas:
|
|
85
|
+
|
|
86
|
+
```powershell
|
|
87
|
+
python scripts/capability_router.py --risk 2 --operation read --tag external_context --available targeted_mcp
|
|
88
|
+
```
|
|
89
|
+
|
|
76
90
|
## health_check.py
|
|
77
91
|
|
|
78
92
|
Roda a validacao geral do framework.
|
|
@@ -137,14 +151,32 @@ instalacao.
|
|
|
137
151
|
python scripts/v03_tests.py
|
|
138
152
|
```
|
|
139
153
|
|
|
154
|
+
## v031_tests.py
|
|
155
|
+
|
|
156
|
+
Testa cobertura, custo, disponibilidade e confirmacao do roteador de
|
|
157
|
+
capacidades.
|
|
158
|
+
|
|
159
|
+
```powershell
|
|
160
|
+
python scripts/v031_tests.py
|
|
161
|
+
```
|
|
162
|
+
|
|
140
163
|
## context_economy_benchmark.py
|
|
141
164
|
|
|
142
|
-
Compara leitura ampla com rotas focadas
|
|
165
|
+
Compara leitura ampla com rotas focadas do protocolo atual.
|
|
143
166
|
|
|
144
167
|
```powershell
|
|
145
168
|
python scripts/context_economy_benchmark.py
|
|
146
169
|
```
|
|
147
170
|
|
|
171
|
+
## capability_economy_benchmark.py
|
|
172
|
+
|
|
173
|
+
Compara carregar o catalogo inteiro com selecionar apenas capacidades
|
|
174
|
+
necessarias.
|
|
175
|
+
|
|
176
|
+
```powershell
|
|
177
|
+
python scripts/capability_economy_benchmark.py
|
|
178
|
+
```
|
|
179
|
+
|
|
148
180
|
## build_dist.py
|
|
149
181
|
|
|
150
182
|
Gera `dist/minimal/` a partir de `AGENTS.md` minimo e `protocol/`.
|
|
@@ -16,12 +16,16 @@ entrega.
|
|
|
16
16
|
2. `protocol/router.yaml`
|
|
17
17
|
3. `protocol/route-packs.yaml`
|
|
18
18
|
4. `memory/INDEX.yaml` somente quando memoria puder ajudar
|
|
19
|
-
5.
|
|
19
|
+
5. `capabilities/registry.yaml` somente quando a tarefa exigir ferramenta
|
|
20
|
+
6. YAML completo da rota somente quando o pack nao bastar
|
|
20
21
|
|
|
21
22
|
## Regras de execucao
|
|
22
23
|
|
|
23
24
|
- Classifique o risco antes de agir.
|
|
24
25
|
- Use o menor contexto suficiente e respeite `protocol/context-budget.yaml`.
|
|
26
|
+
- Use `protocol/capability-router.yaml` para carregar somente skills, MCPs e
|
|
27
|
+
ferramentas necessarias.
|
|
28
|
+
- Risco maior restringe permissao; nao aumenta a quantidade por padrao.
|
|
25
29
|
- Memoria orienta; pedido atual autoriza; codigo verificado define realidade.
|
|
26
30
|
- Nunca amplie escopo com base em previsao ou preferencia antiga.
|
|
27
31
|
- Use `protocol/selective-validation.yaml` para escolher a menor prova suficiente.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
id: capability_registry
|
|
2
|
+
type: capability_registry
|
|
3
|
+
version: 0.3.1
|
|
4
|
+
purpose: project_capabilities_available_to_the_agent
|
|
5
|
+
policy:
|
|
6
|
+
default_available: false
|
|
7
|
+
runtime_availability_must_be_verified: true
|
|
8
|
+
capabilities:
|
|
9
|
+
- id: local_search
|
|
10
|
+
type: local_tool
|
|
11
|
+
available: true
|
|
12
|
+
tags: [code_search, file_discovery]
|
|
13
|
+
operations: [read]
|
|
14
|
+
cost: {tokens: low, latency: low}
|
|
15
|
+
side_effect: none
|
|
16
|
+
confirmation: never
|
|
17
|
+
- id: local_files
|
|
18
|
+
type: local_tool
|
|
19
|
+
available: true
|
|
20
|
+
tags: [file_read, file_write]
|
|
21
|
+
operations: [read, write]
|
|
22
|
+
cost: {tokens: low, latency: low}
|
|
23
|
+
side_effect: local_write
|
|
24
|
+
confirmation: risk_based
|
|
25
|
+
- id: focused_skill
|
|
26
|
+
type: skill
|
|
27
|
+
available: runtime
|
|
28
|
+
tags: [domain_guidance]
|
|
29
|
+
operations: [read]
|
|
30
|
+
cost: {tokens: medium, latency: low}
|
|
31
|
+
side_effect: none
|
|
32
|
+
confirmation: never
|
|
33
|
+
- id: targeted_mcp
|
|
34
|
+
type: mcp
|
|
35
|
+
available: runtime
|
|
36
|
+
tags: [external_context, remote_operation]
|
|
37
|
+
operations: [read, write]
|
|
38
|
+
cost: {tokens: medium, latency: medium}
|
|
39
|
+
side_effect: remote_write
|
|
40
|
+
confirmation: operation_based
|
|
41
|
+
- id: publish_service
|
|
42
|
+
type: remote_service
|
|
43
|
+
available: runtime
|
|
44
|
+
tags: [publish]
|
|
45
|
+
operations: [publish]
|
|
46
|
+
cost: {tokens: low, latency: medium}
|
|
47
|
+
side_effect: publish
|
|
48
|
+
confirmation: always
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: project_context_map
|
|
2
2
|
type: context_map
|
|
3
|
-
version: 0.3
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: small_index_for_progressive_context_retrieval
|
|
5
5
|
maintenance:
|
|
6
6
|
current_mode: manual_bootstrap
|
|
@@ -11,6 +11,7 @@ read_first:
|
|
|
11
11
|
- protocol/router.yaml
|
|
12
12
|
- protocol/route-packs.yaml
|
|
13
13
|
- memory/INDEX.yaml
|
|
14
|
+
- capabilities/registry.yaml
|
|
14
15
|
domains: {}
|
|
15
16
|
retrieval_policy:
|
|
16
17
|
order:
|