ai-execution-protocol 0.2.1 → 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 +18 -1
- package/README.md +42 -6
- package/dist/minimal/.aiignore +8 -8
- package/dist/minimal/AGENTS.md +45 -63
- package/dist/minimal/candidate-memory/README.md +4 -0
- package/dist/minimal/canonical-state.yaml +16 -14
- package/dist/minimal/capabilities/registry.yaml +48 -0
- package/dist/minimal/context-map.yaml +23 -20
- package/dist/minimal/decisions/README.md +4 -7
- package/dist/minimal/memory/INDEX.yaml +20 -0
- package/dist/minimal/protocol/README.yaml +9 -1
- package/dist/minimal/protocol/adaptive-memory.yaml +97 -0
- package/dist/minimal/protocol/capability-router.yaml +123 -0
- package/dist/minimal/protocol/context-budget.yaml +44 -0
- package/dist/minimal/protocol/context-compiler.yaml +24 -1
- package/dist/minimal/protocol/fast-path.yaml +8 -1
- package/dist/minimal/protocol/persistent-context.yaml +13 -3
- package/dist/minimal/protocol/prompt-economy.yaml +16 -8
- package/dist/minimal/protocol/route-packs.yaml +43 -1
- package/dist/minimal/protocol/router.yaml +30 -1
- package/dist/minimal/protocol/selective-validation.yaml +44 -0
- package/dist/minimal/protocol/validation-checklist.yaml +10 -1
- package/install-manifest.json +75 -0
- package/package.json +3 -1
- package/protocol/README.yaml +9 -1
- package/protocol/adaptive-memory.yaml +97 -0
- package/protocol/capability-router.yaml +123 -0
- package/protocol/context-budget.yaml +44 -0
- package/protocol/context-compiler.yaml +24 -1
- package/protocol/fast-path.yaml +8 -1
- package/protocol/persistent-context.yaml +13 -3
- package/protocol/prompt-economy.yaml +16 -8
- package/protocol/route-packs.yaml +43 -1
- package/protocol/router.yaml +30 -1
- package/protocol/selective-validation.yaml +44 -0
- package/protocol/validation-checklist.yaml +10 -1
- package/scripts/README.md +75 -0
- package/scripts/build_dist.py +12 -151
- package/scripts/npm_install_protocol.js +10 -161
- package/scripts/verify_install.py +23 -79
- package/templates/minimal/.aiignore +8 -0
- package/templates/minimal/AGENTS.md +45 -0
- package/templates/minimal/candidate-memory/README.md +4 -0
- package/templates/minimal/canonical-state.yaml +16 -0
- package/templates/minimal/capabilities/registry.yaml +48 -0
- package/templates/minimal/context-map.yaml +23 -0
- package/templates/minimal/decisions/README.md +4 -0
- package/templates/minimal/memory/INDEX.yaml +20 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
id: adaptive_memory
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.3
|
|
4
|
+
purpose: evolve_with_user_and_project_through_verified_external_memory
|
|
5
|
+
principle: memory_guides_current_request_authorizes_verified_files_define_reality
|
|
6
|
+
entrypoints:
|
|
7
|
+
- memory/INDEX.yaml
|
|
8
|
+
- memory/user/
|
|
9
|
+
- memory/projects/
|
|
10
|
+
- memory/patterns/
|
|
11
|
+
- candidate-memory/
|
|
12
|
+
authority_order:
|
|
13
|
+
- current_user_request
|
|
14
|
+
- verified_current_files
|
|
15
|
+
- active_project_decisions
|
|
16
|
+
- explicit_user_preferences
|
|
17
|
+
- inferred_patterns_with_evidence
|
|
18
|
+
- conversation_summary
|
|
19
|
+
- old_history
|
|
20
|
+
memory_types:
|
|
21
|
+
explicit_preference:
|
|
22
|
+
promotion: automatic_when_non_sensitive_and_explicit
|
|
23
|
+
project_decision:
|
|
24
|
+
promotion: automatic_when_confirmed_and_scoped
|
|
25
|
+
project_state:
|
|
26
|
+
promotion: require_current_file_evidence
|
|
27
|
+
inferred_preference:
|
|
28
|
+
promotion: candidate_until_repeated_or_confirmed
|
|
29
|
+
workflow_pattern:
|
|
30
|
+
promotion: candidate_until_repeated
|
|
31
|
+
conversation_summary:
|
|
32
|
+
promotion: optional_and_never_mandatory_context
|
|
33
|
+
required_fields:
|
|
34
|
+
- id
|
|
35
|
+
- type
|
|
36
|
+
- subject
|
|
37
|
+
- value
|
|
38
|
+
- scope
|
|
39
|
+
- status
|
|
40
|
+
- confidence
|
|
41
|
+
- source
|
|
42
|
+
- evidence_count
|
|
43
|
+
- sensitive
|
|
44
|
+
- created_at
|
|
45
|
+
- updated_at
|
|
46
|
+
status:
|
|
47
|
+
active:
|
|
48
|
+
use: current_memory
|
|
49
|
+
candidate:
|
|
50
|
+
use: not_authoritative
|
|
51
|
+
replaced:
|
|
52
|
+
use: history_only
|
|
53
|
+
revoked:
|
|
54
|
+
use: never_as_current_truth
|
|
55
|
+
expired:
|
|
56
|
+
use: revalidate_before_use
|
|
57
|
+
maintenance:
|
|
58
|
+
always_check_after_task: true
|
|
59
|
+
allowed_results:
|
|
60
|
+
- updated
|
|
61
|
+
- unchanged
|
|
62
|
+
- candidate
|
|
63
|
+
- replaced
|
|
64
|
+
- blocked_sensitive
|
|
65
|
+
flow:
|
|
66
|
+
- extract_candidate
|
|
67
|
+
- classify_sensitivity
|
|
68
|
+
- search_existing_subject_and_aliases
|
|
69
|
+
- compare_value_scope_and_source
|
|
70
|
+
- merge_replace_or_discard
|
|
71
|
+
- update_index
|
|
72
|
+
- validate_duplicates_conflicts_and_size
|
|
73
|
+
safety:
|
|
74
|
+
never_store:
|
|
75
|
+
- passwords
|
|
76
|
+
- api_tokens
|
|
77
|
+
- private_keys
|
|
78
|
+
- customer_data
|
|
79
|
+
- unnecessary_personal_data
|
|
80
|
+
- raw_logs
|
|
81
|
+
- unredacted_sensitive_conversation
|
|
82
|
+
prediction:
|
|
83
|
+
allow:
|
|
84
|
+
- suggest_likely_preference
|
|
85
|
+
- choose_low_risk_defaults
|
|
86
|
+
never:
|
|
87
|
+
- expand_scope
|
|
88
|
+
- authorize_sensitive_action
|
|
89
|
+
- override_current_request
|
|
90
|
+
- claim_perfect_prediction
|
|
91
|
+
economy:
|
|
92
|
+
- read_index_before_memory_files
|
|
93
|
+
- retrieve_only_matching_subjects
|
|
94
|
+
- do_not_load_archive_by_default
|
|
95
|
+
- do_not_write_when_result_is_unchanged
|
|
96
|
+
- keep_one_trackable_subject_per_file
|
|
97
|
+
- enforce_context_budget
|
|
@@ -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
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
id: context_budget
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.3
|
|
4
|
+
purpose: limit_context_cost_without_trading_correctness_or_safety
|
|
5
|
+
principle: budget_guides_reading_risk_can_justify_expansion
|
|
6
|
+
levels:
|
|
7
|
+
level_0:
|
|
8
|
+
initial_tokens_est: 300
|
|
9
|
+
max_files_before_justification: 2
|
|
10
|
+
level_1:
|
|
11
|
+
initial_tokens_est: 1000
|
|
12
|
+
max_files_before_justification: 5
|
|
13
|
+
level_2:
|
|
14
|
+
initial_tokens_est: 4000
|
|
15
|
+
max_files_before_justification: 12
|
|
16
|
+
level_3:
|
|
17
|
+
initial_tokens_est: 6000
|
|
18
|
+
mode: adaptive
|
|
19
|
+
max_files_before_justification: 20
|
|
20
|
+
count:
|
|
21
|
+
- protocol_rules
|
|
22
|
+
- memory_entries
|
|
23
|
+
- project_docs
|
|
24
|
+
- code_snippets
|
|
25
|
+
exclude:
|
|
26
|
+
- generated_reports_not_read
|
|
27
|
+
- files_only_listed_not_opened
|
|
28
|
+
expansion_requires:
|
|
29
|
+
- unresolved_risk
|
|
30
|
+
- missing_dependency
|
|
31
|
+
- unclear_scope
|
|
32
|
+
- insufficient_snippet
|
|
33
|
+
- validation_gap
|
|
34
|
+
stop_when:
|
|
35
|
+
- objective_is_clear
|
|
36
|
+
- target_is_identified
|
|
37
|
+
- risk_is_classified
|
|
38
|
+
- validation_plan_is_clear
|
|
39
|
+
- no_unresolved_gap_requires_more_context
|
|
40
|
+
delivery:
|
|
41
|
+
report_when_exceeded:
|
|
42
|
+
- initial_budget
|
|
43
|
+
- estimated_context_used
|
|
44
|
+
- expansion_reason
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: context_compiler
|
|
2
2
|
type: operational_rules
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.3
|
|
4
4
|
purpose: build_minimum_context_package_before_model_reasoning
|
|
5
5
|
principle: conversation_is_interface_not_source_of_truth
|
|
6
6
|
canonical_state:
|
|
@@ -28,19 +28,25 @@ context_build:
|
|
|
28
28
|
- user_request
|
|
29
29
|
- route_from_router
|
|
30
30
|
- risk_level
|
|
31
|
+
- context_budget
|
|
31
32
|
- candidate_files_or_areas
|
|
33
|
+
- matching_memory_subjects
|
|
32
34
|
- recent_validated_state
|
|
33
35
|
output:
|
|
34
36
|
- objective
|
|
35
37
|
- constraints
|
|
36
38
|
- relevant_rules
|
|
39
|
+
- matching_memory
|
|
37
40
|
- candidate_files
|
|
41
|
+
- estimated_tokens
|
|
42
|
+
- budget_status
|
|
38
43
|
- validation_plan
|
|
39
44
|
- excluded_context
|
|
40
45
|
selection_policy:
|
|
41
46
|
include:
|
|
42
47
|
- context_map_domain_when_available
|
|
43
48
|
- active_decisions_for_matched_domain
|
|
49
|
+
- active_memory_matching_subject_and_scope
|
|
44
50
|
- files_required_by_route
|
|
45
51
|
- snippets_matching_task_terms
|
|
46
52
|
- current_decisions_touching_candidate_area
|
|
@@ -51,6 +57,7 @@ selection_policy:
|
|
|
51
57
|
- full_logs_without_error_focus
|
|
52
58
|
- revoked_decisions_unless_comparing_history
|
|
53
59
|
- entire_large_files_when_snippet_is_enough
|
|
60
|
+
- candidate_or_archived_memory_without_task_match
|
|
54
61
|
memory_layers:
|
|
55
62
|
active:
|
|
56
63
|
definition: required_to_complete_current_task
|
|
@@ -93,6 +100,21 @@ decision_rules:
|
|
|
93
100
|
avoid:
|
|
94
101
|
- treating_alias_as_source_of_truth
|
|
95
102
|
- editing_from_snippet_when_behavior_depends_on_unread_context
|
|
103
|
+
- id: CTX_006
|
|
104
|
+
when: persistent_memory_may_be_relevant
|
|
105
|
+
do:
|
|
106
|
+
- read_memory_index_first
|
|
107
|
+
- retrieve_only_matching_active_entries
|
|
108
|
+
- verify_project_state_against_current_files
|
|
109
|
+
avoid:
|
|
110
|
+
- loading_all_memory
|
|
111
|
+
- treating_candidate_memory_as_authoritative
|
|
112
|
+
- id: CTX_007
|
|
113
|
+
when: initial_context_budget_is_reached
|
|
114
|
+
do:
|
|
115
|
+
- stop_if_objective_target_and_validation_are_clear
|
|
116
|
+
- expand_only_for_unresolved_risk_dependency_scope_or_validation_gap
|
|
117
|
+
- record_expansion_reason
|
|
96
118
|
retrieval_tiers:
|
|
97
119
|
mvp:
|
|
98
120
|
use:
|
|
@@ -121,6 +143,7 @@ delivery:
|
|
|
121
143
|
include_when_relevant:
|
|
122
144
|
- context_used
|
|
123
145
|
- context_excluded
|
|
146
|
+
- context_budget_status
|
|
124
147
|
- reason_for_not_reading_more
|
|
125
148
|
economy_goal:
|
|
126
149
|
target: reduce_unneeded_context_up_to_90_percent_when_safe
|
package/protocol/fast-path.yaml
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
id: fast_path
|
|
2
2
|
type: agent_entrypoint
|
|
3
|
-
version: 0.1
|
|
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
|
+
- context-budget.yaml
|
|
9
|
+
- capability-router.yaml
|
|
8
10
|
- modes.yaml
|
|
9
11
|
core_rules:
|
|
10
12
|
- classify_risk_before_action
|
|
@@ -20,6 +22,10 @@ core_rules:
|
|
|
20
22
|
- include_test_list_when_break_risk_exists
|
|
21
23
|
- explain_in_plain_language_for_non_experts
|
|
22
24
|
- use_context_compiler_when_context_or_history_is_large
|
|
25
|
+
- use_only_matching_memory_subjects
|
|
26
|
+
- check_memory_update_result_after_task
|
|
27
|
+
- use_selective_validation_by_blast_radius
|
|
28
|
+
- select_minimum_capability_set_before_loading_skills_or_mcps
|
|
23
29
|
risk_short:
|
|
24
30
|
level_0: answer_only
|
|
25
31
|
level_1: small_clear_reversible_isolated_change
|
|
@@ -32,3 +38,4 @@ file_policy:
|
|
|
32
38
|
stop_reading_when:
|
|
33
39
|
- enough_context_to_act_safely
|
|
34
40
|
- validation_plan_is_clear
|
|
41
|
+
- context_budget_is_sufficient
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: persistent_context
|
|
2
2
|
type: operational_rules
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.3
|
|
4
4
|
purpose: navigate_project_memory_without_loading_unneeded_context
|
|
5
5
|
principle: aliases_are_pointers_not_truth
|
|
6
6
|
autonomous_memory:
|
|
@@ -22,6 +22,7 @@ economy_goal:
|
|
|
22
22
|
entrypoints:
|
|
23
23
|
- canonical-state.yaml
|
|
24
24
|
- context-map.yaml
|
|
25
|
+
- memory/INDEX.yaml
|
|
25
26
|
- decisions/
|
|
26
27
|
progressive_retrieval:
|
|
27
28
|
order:
|
|
@@ -29,6 +30,8 @@ progressive_retrieval:
|
|
|
29
30
|
- match_domain_or_alias_in_context_map
|
|
30
31
|
- read_canonical_state_when_project_truth_matters
|
|
31
32
|
- read_active_decisions_for_domain
|
|
33
|
+
- query_memory_index_for_matching_subjects
|
|
34
|
+
- read_only_matching_active_memory
|
|
32
35
|
- read_only_needed_atomic_subject_docs
|
|
33
36
|
- search_candidate_symbols_or_files
|
|
34
37
|
- read_relevant_snippet_first
|
|
@@ -51,6 +54,8 @@ context_validator:
|
|
|
51
54
|
check:
|
|
52
55
|
- enough_context_for_objective
|
|
53
56
|
- active_decisions_loaded_when_relevant
|
|
57
|
+
- matching_memory_loaded_only_when_relevant
|
|
58
|
+
- context_budget_respected_or_expansion_justified
|
|
54
59
|
- direct_dependencies_loaded_when_needed
|
|
55
60
|
- adjacent_domain_risk_checked
|
|
56
61
|
- docs_do_not_conflict_with_verified_files
|
|
@@ -88,9 +93,11 @@ snippet_policy:
|
|
|
88
93
|
conflict_policy:
|
|
89
94
|
order:
|
|
90
95
|
- current_user_request
|
|
91
|
-
- canonical_state
|
|
92
|
-
- active_decisions
|
|
93
96
|
- verified_code_or_files_this_turn
|
|
97
|
+
- active_decisions
|
|
98
|
+
- canonical_state
|
|
99
|
+
- explicit_user_preferences
|
|
100
|
+
- inferred_patterns_with_evidence
|
|
94
101
|
- domain_docs
|
|
95
102
|
- current_conversation
|
|
96
103
|
if_docs_conflict_with_code:
|
|
@@ -100,6 +107,9 @@ validation:
|
|
|
100
107
|
require:
|
|
101
108
|
- state_context_used_when_relevant
|
|
102
109
|
- state_context_not_loaded_when_excluded_for_economy
|
|
110
|
+
- memory_index_used_before_memory_files
|
|
111
|
+
- memory_update_result_recorded_when_new_durable_fact_exists
|
|
112
|
+
- sensitive_or_unverified_content_not_promoted
|
|
103
113
|
- escalate_context_if_snippet_is_insufficient
|
|
104
114
|
- update_subject_index_when_docs_are_split
|
|
105
115
|
atomic_subject_flow:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: prompt_economy
|
|
2
2
|
type: operational_rules
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.3
|
|
4
4
|
purpose: improve_user_prompt_without_token_bloat
|
|
5
5
|
principle: always_improve_prompt_only_as_much_as_needed_for_safe_execution
|
|
6
6
|
rules:
|
|
@@ -34,15 +34,20 @@ rules:
|
|
|
34
34
|
- validation
|
|
35
35
|
- confirmation_if_needed
|
|
36
36
|
- id: PROMPT_005
|
|
37
|
-
name:
|
|
37
|
+
name: show_prompt_comparison_when_interpretation_matters
|
|
38
38
|
do:
|
|
39
|
-
-
|
|
40
|
-
-
|
|
39
|
+
- include_user_original_prompt_for_technical_or_interpreted_tasks
|
|
40
|
+
- include_ai_improved_prompt_for_technical_or_interpreted_tasks
|
|
41
41
|
- keep_comparison_to_minimum_viable_words
|
|
42
42
|
- preserve_user_language_when_possible
|
|
43
43
|
avoid:
|
|
44
44
|
- hiding_interpretation_from_user
|
|
45
45
|
- expanding_simple_requests_into_large_specs
|
|
46
|
+
may_omit_when:
|
|
47
|
+
- level_0
|
|
48
|
+
- no_technical_action
|
|
49
|
+
- no_scope_or_intent_interpretation
|
|
50
|
+
- direct_answer_is_clearer
|
|
46
51
|
limits:
|
|
47
52
|
level_0:
|
|
48
53
|
max_lines: 5
|
|
@@ -75,16 +80,19 @@ delivery_rule:
|
|
|
75
80
|
- "Feito: <what changed or answer>"
|
|
76
81
|
- "Validado: <evidence or not run>"
|
|
77
82
|
- "Risco: <residual risk or none>"
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
83
|
+
show_when:
|
|
84
|
+
- technical_action
|
|
85
|
+
- scope_interpretation
|
|
86
|
+
- risk_level_1_or_higher
|
|
87
|
+
- prompt_improvement_changes_execution
|
|
81
88
|
comparison:
|
|
82
89
|
- original_prompt_must_keep_user_words_when_reasonable
|
|
83
90
|
- improved_prompt_must_state_objective_scope_risk_validation
|
|
84
91
|
- improved_prompt_must_fit_risk_level_limits
|
|
85
92
|
token_policy:
|
|
86
93
|
- use_abbreviated_labels_po_pm_when_user_did_not_request_full_form
|
|
87
|
-
-
|
|
94
|
+
- level_0_may_use_direct_answer_when_comparison_adds_no_value
|
|
95
|
+
- level_1_use_micro_template
|
|
88
96
|
- level_2_use_compact_objective_scope_validation
|
|
89
97
|
- level_3_include_risk_confirmation_without_long_spec
|
|
90
98
|
- omit_tests_line_when_no_break_risk_exists
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: route_packs
|
|
2
2
|
type: route_summary_index
|
|
3
|
-
version: 0.1
|
|
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:
|
|
@@ -151,3 +151,45 @@ packs:
|
|
|
151
151
|
- read_atomic_subject_doc_before_broad_doc
|
|
152
152
|
- search_with_rg_before_full_file_reads
|
|
153
153
|
- expand_context_without_expanding_scope
|
|
154
|
+
memory_update:
|
|
155
|
+
risk: 1
|
|
156
|
+
read_if_pack_insufficient:
|
|
157
|
+
- adaptive-memory.yaml
|
|
158
|
+
- context-budget.yaml
|
|
159
|
+
- validation-checklist.yaml
|
|
160
|
+
do:
|
|
161
|
+
- extract_only_stable_non_sensitive_knowledge
|
|
162
|
+
- search_before_create
|
|
163
|
+
- merge_replace_or_keep_unchanged
|
|
164
|
+
- update_memory_index
|
|
165
|
+
- report_memory_update_result
|
|
166
|
+
memory_conflict_or_replacement:
|
|
167
|
+
risk: 2
|
|
168
|
+
read_if_pack_insufficient:
|
|
169
|
+
- adaptive-memory.yaml
|
|
170
|
+
- context-compiler.yaml
|
|
171
|
+
- validation-checklist.yaml
|
|
172
|
+
do:
|
|
173
|
+
- preserve_provenance
|
|
174
|
+
- mark_old_entry_replaced
|
|
175
|
+
- keep_current_request_authoritative
|
|
176
|
+
- validate_no_duplicate_active_entry
|
|
177
|
+
selective_validation:
|
|
178
|
+
risk: 1
|
|
179
|
+
read_if_pack_insufficient:
|
|
180
|
+
- selective-validation.yaml
|
|
181
|
+
do:
|
|
182
|
+
- infer_checks_from_changed_files
|
|
183
|
+
- run_smallest_sufficient_validation
|
|
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.1
|
|
3
|
+
version: 0.3.1
|
|
4
4
|
purpose: choose_minimum_protocol_files_by_task
|
|
5
5
|
default_read:
|
|
6
6
|
- fast-path.yaml
|
|
@@ -93,11 +93,40 @@ routes:
|
|
|
93
93
|
- persistent-context.yaml
|
|
94
94
|
- context-rules.yaml
|
|
95
95
|
- context-compiler.yaml
|
|
96
|
+
- context-budget.yaml
|
|
97
|
+
memory_update:
|
|
98
|
+
risk: 1
|
|
99
|
+
read:
|
|
100
|
+
- fast-path.yaml
|
|
101
|
+
- adaptive-memory.yaml
|
|
102
|
+
- context-budget.yaml
|
|
103
|
+
- validation-checklist.yaml
|
|
104
|
+
memory_conflict_or_replacement:
|
|
105
|
+
risk: 2
|
|
106
|
+
read:
|
|
107
|
+
- fast-path.yaml
|
|
108
|
+
- adaptive-memory.yaml
|
|
109
|
+
- context-compiler.yaml
|
|
110
|
+
- validation-checklist.yaml
|
|
111
|
+
selective_validation:
|
|
112
|
+
risk: 1
|
|
113
|
+
read:
|
|
114
|
+
- fast-path.yaml
|
|
115
|
+
- selective-validation.yaml
|
|
116
|
+
capability_selection:
|
|
117
|
+
risk: adaptive
|
|
118
|
+
read:
|
|
119
|
+
- fast-path.yaml
|
|
120
|
+
- capability-router.yaml
|
|
121
|
+
- context-budget.yaml
|
|
96
122
|
rules:
|
|
97
123
|
- start_with_default_read
|
|
98
124
|
- choose_one_route_if_task_type_is_clear
|
|
99
125
|
- read_route_pack_before_full_route_files_when_available
|
|
100
126
|
- expand_from_route_pack_only_when_needed
|
|
127
|
+
- apply_context_budget_to_selected_route
|
|
128
|
+
- retrieve_only_matching_memory_subjects
|
|
129
|
+
- select_capabilities_before_loading_skill_or_connecting_mcp
|
|
101
130
|
- if_route_unclear_read_risk_levels_then_choose_route
|
|
102
131
|
- do_not_read_docs_unless_protocol_is_insufficient
|
|
103
132
|
- do_not_read_cases_unless_testing_or_comparing_behavior
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
id: selective_validation
|
|
2
|
+
type: operational_rules
|
|
3
|
+
version: 0.3
|
|
4
|
+
purpose: run_smallest_validation_set_that_proves_the_change
|
|
5
|
+
principle: validation_scales_with_behavior_and_blast_radius
|
|
6
|
+
selection:
|
|
7
|
+
docs_only:
|
|
8
|
+
run:
|
|
9
|
+
- link_check
|
|
10
|
+
- text_search
|
|
11
|
+
- schema_if_structured
|
|
12
|
+
protocol_rule:
|
|
13
|
+
run:
|
|
14
|
+
- schema_validation
|
|
15
|
+
- mirror_sync
|
|
16
|
+
- framework_targeted_tests
|
|
17
|
+
parser_or_evaluator:
|
|
18
|
+
run:
|
|
19
|
+
- parser_adversarial_tests
|
|
20
|
+
- framework_tests
|
|
21
|
+
- benchmark_runner
|
|
22
|
+
installer_or_package:
|
|
23
|
+
run:
|
|
24
|
+
- install_test
|
|
25
|
+
- verify_install
|
|
26
|
+
- package_dry_run
|
|
27
|
+
shared_or_cross_module:
|
|
28
|
+
run:
|
|
29
|
+
- framework_tests
|
|
30
|
+
- health_check
|
|
31
|
+
release:
|
|
32
|
+
run:
|
|
33
|
+
- framework_tests
|
|
34
|
+
- schema_strict
|
|
35
|
+
- health_check
|
|
36
|
+
- npm_dry_run
|
|
37
|
+
- python_build
|
|
38
|
+
- twine_check
|
|
39
|
+
rules:
|
|
40
|
+
- infer_validation_from_changed_files_and_behavior
|
|
41
|
+
- expand_validation_when_shared_contract_changes
|
|
42
|
+
- never_claim_unrun_validation
|
|
43
|
+
- full_health_check_is_not_required_for_every_small_change
|
|
44
|
+
- user_visible_or_critical_change_requires_manual_test_guidance
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
id: validation_checklist
|
|
2
2
|
type: checklist
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.3
|
|
4
|
+
selection_source: protocol/selective-validation.yaml
|
|
4
5
|
automatic_validation:
|
|
5
6
|
- unit_tests
|
|
6
7
|
- integration_tests
|
|
@@ -57,3 +58,11 @@ rules:
|
|
|
57
58
|
- make_limits_and_residual_risk_understandable
|
|
58
59
|
- prefer_one_line_per_delivery_field
|
|
59
60
|
- use_micro_format_only_when_readable
|
|
61
|
+
- id: VAL_005
|
|
62
|
+
always:
|
|
63
|
+
- select_smallest_validation_set_that_proves_behavior
|
|
64
|
+
- expand_when_shared_contract_or_blast_radius_requires
|
|
65
|
+
- record_every_expected_validation_not_run
|
|
66
|
+
avoid:
|
|
67
|
+
- full_health_check_for_trivial_local_change
|
|
68
|
+
- unrelated_expensive_validation
|