ai-execution-protocol 0.2.0 → 0.3.0

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.
Files changed (48) hide show
  1. package/AGENTS.md +14 -1
  2. package/README.md +32 -22
  3. package/dist/minimal/.aiignore +8 -8
  4. package/dist/minimal/AGENTS.md +41 -61
  5. package/dist/minimal/candidate-memory/README.md +4 -0
  6. package/dist/minimal/canonical-state.yaml +16 -0
  7. package/dist/minimal/context-map.yaml +22 -0
  8. package/dist/minimal/decisions/README.md +4 -0
  9. package/dist/minimal/memory/INDEX.yaml +20 -0
  10. package/dist/minimal/protocol/README.yaml +9 -1
  11. package/dist/minimal/protocol/adaptive-memory.yaml +97 -0
  12. package/dist/minimal/protocol/context-budget.yaml +44 -0
  13. package/dist/minimal/protocol/context-compiler.yaml +24 -1
  14. package/dist/minimal/protocol/context-rules.yaml +13 -0
  15. package/dist/minimal/protocol/fast-path.yaml +7 -1
  16. package/dist/minimal/protocol/formatting-rules.yaml +27 -0
  17. package/dist/minimal/protocol/persistent-context.yaml +40 -4
  18. package/dist/minimal/protocol/prompt-economy.yaml +16 -8
  19. package/dist/minimal/protocol/route-packs.yaml +184 -0
  20. package/dist/minimal/protocol/router.yaml +25 -1
  21. package/dist/minimal/protocol/selective-validation.yaml +44 -0
  22. package/dist/minimal/protocol/validation-checklist.yaml +10 -1
  23. package/install-manifest.json +64 -0
  24. package/package.json +3 -1
  25. package/protocol/README.yaml +9 -1
  26. package/protocol/adaptive-memory.yaml +97 -0
  27. package/protocol/context-budget.yaml +44 -0
  28. package/protocol/context-compiler.yaml +24 -1
  29. package/protocol/context-rules.yaml +13 -0
  30. package/protocol/fast-path.yaml +7 -1
  31. package/protocol/formatting-rules.yaml +27 -0
  32. package/protocol/persistent-context.yaml +40 -4
  33. package/protocol/prompt-economy.yaml +16 -8
  34. package/protocol/route-packs.yaml +184 -0
  35. package/protocol/router.yaml +25 -1
  36. package/protocol/selective-validation.yaml +44 -0
  37. package/protocol/validation-checklist.yaml +10 -1
  38. package/scripts/README.md +43 -0
  39. package/scripts/build_dist.py +12 -94
  40. package/scripts/npm_install_protocol.js +22 -100
  41. package/scripts/verify_install.py +23 -62
  42. package/templates/minimal/.aiignore +8 -0
  43. package/templates/minimal/AGENTS.md +41 -0
  44. package/templates/minimal/candidate-memory/README.md +4 -0
  45. package/templates/minimal/canonical-state.yaml +16 -0
  46. package/templates/minimal/context-map.yaml +22 -0
  47. package/templates/minimal/decisions/README.md +4 -0
  48. package/templates/minimal/memory/INDEX.yaml +20 -0
@@ -6,6 +6,7 @@ priority:
6
6
  second: human_readability
7
7
  principles:
8
8
  - one_main_subject_per_file
9
+ - atomic_docs_by_trackable_subject
9
10
  - stable_keys
10
11
  - direct_names
11
12
  - short_lists
@@ -73,3 +74,29 @@ maintenance:
73
74
  if_near_limit:
74
75
  - split_by_theme
75
76
  - update_readme
77
+ atomic_documentation:
78
+ principle: one_file_one_trackable_subject
79
+ use_for:
80
+ - domain
81
+ - flow
82
+ - decision
83
+ - component
84
+ - integration
85
+ - validation_area
86
+ naming:
87
+ do:
88
+ - include_search_terms_in_filename
89
+ - prefer_domain_flow_or_component_names
90
+ - keep_titles_matching_filename_subject
91
+ avoid:
92
+ - generic_names_like_general_notes_part1
93
+ - duplicate_files_for_same_subject
94
+ - oversized_docs_with_multiple_unrelated_subjects
95
+ split_when:
96
+ - file_has_multiple_independent_subjects
97
+ - file_nears_line_limit
98
+ - rg_search_would_match_unrelated_sections
99
+ update_when_split:
100
+ - docs_readme
101
+ - index_or_context_map_when_relevant
102
+ - aliases_when_subject_terms_change
@@ -1,6 +1,6 @@
1
1
  id: persistent_context
2
2
  type: operational_rules
3
- version: 0.2
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,7 +30,9 @@ 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
32
- - read_only_needed_domain_docs
33
+ - query_memory_index_for_matching_subjects
34
+ - read_only_matching_active_memory
35
+ - read_only_needed_atomic_subject_docs
33
36
  - search_candidate_symbols_or_files
34
37
  - read_relevant_snippet_first
35
38
  - read_direct_dependencies_when_needed
@@ -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,4 +107,33 @@ 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
114
+ - update_subject_index_when_docs_are_split
115
+ atomic_subject_flow:
116
+ order:
117
+ - identify_subject_terms_from_request
118
+ - find_subject_doc_by_context_map_index_or_rg
119
+ - read_subject_doc_before_broad_doc
120
+ - use_rg_for_exact_code_symbol_or_term
121
+ - read_code_snippet_first
122
+ - expand_to_full_file_or_related_doc_when_needed
123
+ failure_mitigations:
124
+ fragmentation:
125
+ - do_not_create_doc_for_micro_detail_without_standalone_subject
126
+ - merge_or_link_overlapping_docs
127
+ bad_names:
128
+ - include_domain_flow_component_or_symbol_terms_in_filename
129
+ duplicates:
130
+ - search_existing_docs_before_creating_new_doc
131
+ - prefer_updating_existing_subject_doc
132
+ stale_docs:
133
+ - verify_current_code_before_behavior_claim
134
+ - report_stale_doc_risk
135
+ wrong_search_terms:
136
+ - use_aliases_and_synonyms_as_search_terms
137
+ - search_docs_and_code_with_rg
138
+ insufficient_snippet:
139
+ - expand_to_imports_types_callers_or_full_file
@@ -1,6 +1,6 @@
1
1
  id: prompt_economy
2
2
  type: operational_rules
3
- version: 0.1
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: always_show_prompt_comparison
37
+ name: show_prompt_comparison_when_interpretation_matters
38
38
  do:
39
- - include_user_original_prompt
40
- - include_ai_improved_prompt
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
- always_show:
79
- - prompt_original
80
- - prompt_melhorado_da_ia
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
- - level_0_and_1_use_micro_template
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
@@ -0,0 +1,184 @@
1
+ id: route_packs
2
+ type: route_summary_index
3
+ version: 0.3
4
+ purpose: compact_first_read_before_full_route_files
5
+ principle: read_pack_first_expand_only_when_needed
6
+ use:
7
+ - after_router_selects_route
8
+ - before_opening_all_route_files
9
+ - when_task_is_clear_enough_for_compact_rules
10
+ expand_when:
11
+ - risk_or_scope_is_unclear
12
+ - validation_plan_is_not_clear
13
+ - route_pack_conflicts_with_user_request
14
+ - task_is_level_2_or_3_and_impact_is_not_mapped
15
+ - yaml_schema_or_exact_rule_text_is_needed
16
+ packs:
17
+ simple_answer:
18
+ risk: 0
19
+ read_if_pack_insufficient:
20
+ - fast-path.yaml
21
+ do:
22
+ - answer_directly
23
+ - avoid_plan_or_file_reads
24
+ - keep_po_pm_ok_short_when_required
25
+ small_fix:
26
+ risk: 1
27
+ read_if_pack_insufficient:
28
+ - fast-path.yaml
29
+ - validation-checklist.yaml
30
+ do:
31
+ - identify_small_reversible_target
32
+ - read_focused_context
33
+ - change_minimum_needed
34
+ - validate_directly
35
+ user_flow_bug:
36
+ risk: 2
37
+ read_if_pack_insufficient:
38
+ - context-compiler.yaml
39
+ - risk-levels.yaml
40
+ - mapping-checklists.yaml
41
+ - validation-checklist.yaml
42
+ do:
43
+ - map_flow_candidate_files_and_regression_risk
44
+ - read_snippets_before_full_files
45
+ - preserve_expected_behavior
46
+ - validate_main_success_and_failure_paths
47
+ refactor:
48
+ risk: 2
49
+ read_if_pack_insufficient:
50
+ - context-compiler.yaml
51
+ - mapping-checklists.yaml
52
+ - validation-checklist.yaml
53
+ - spec-driven.yaml
54
+ do:
55
+ - define_behavior_to_preserve
56
+ - keep_scope_incremental
57
+ - avoid_new_features
58
+ - validate_behavior_after_change
59
+ feature_or_spec:
60
+ risk: 2
61
+ read_if_pack_insufficient:
62
+ - context-compiler.yaml
63
+ - risk-levels.yaml
64
+ - mapping-checklists.yaml
65
+ - validation-checklist.yaml
66
+ - spec-driven.yaml
67
+ do:
68
+ - use_light_spec_when_scope_or_risk_benefits
69
+ - define_objective_scope_validation
70
+ - implement_incrementally
71
+ - avoid_full_spec_for_small_clear_tasks
72
+ docs_update:
73
+ risk: 1
74
+ read_if_pack_insufficient:
75
+ - context-rules.yaml
76
+ - formatting-rules.yaml
77
+ do:
78
+ - update_only_affected_docs
79
+ - keep_docs_atomic_by_subject
80
+ - verify_links_or_references
81
+ - update_index_when_structure_changes
82
+ database_or_data:
83
+ risk: 3
84
+ read_if_pack_insufficient:
85
+ - context-compiler.yaml
86
+ - risk-levels.yaml
87
+ - mapping-checklists.yaml
88
+ - validation-checklist.yaml
89
+ - spec-driven.yaml
90
+ do:
91
+ - map_affected_data
92
+ - avoid_destructive_action_without_confirmation
93
+ - define_backup_or_rollback
94
+ - validate_before_and_after
95
+ auth_security_secret:
96
+ risk: 3
97
+ read_if_pack_insufficient:
98
+ - context-compiler.yaml
99
+ - risk-levels.yaml
100
+ - mapping-checklists.yaml
101
+ - validation-checklist.yaml
102
+ - spec-driven.yaml
103
+ do:
104
+ - map_security_surface
105
+ - avoid_exposing_secrets
106
+ - require_confirmation_for_sensitive_write
107
+ - validate_allowed_and_denied_paths
108
+ deploy_or_production:
109
+ risk: 3
110
+ read_if_pack_insufficient:
111
+ - context-compiler.yaml
112
+ - risk-levels.yaml
113
+ - validation-checklist.yaml
114
+ - context-rules.yaml
115
+ - spec-driven.yaml
116
+ do:
117
+ - verify_local_state
118
+ - run_pre_deploy_validation
119
+ - require_confirmation_before_deploy
120
+ - run_post_deploy_check_if_executed
121
+ evaluate_response:
122
+ read_if_pack_insufficient:
123
+ - ../eval/rubric.yaml
124
+ - ../schema/evaluated-response.schema.json
125
+ do:
126
+ - score_risk_behavior_avoidance_delivery_clarity
127
+ - apply_automatic_fail_rules
128
+ create_or_edit_yaml:
129
+ read_if_pack_insufficient:
130
+ - formatting-rules.yaml
131
+ - ../schema/protocol-rule.schema.yaml
132
+ do:
133
+ - keep_yaml_compact
134
+ - validate_schema_when_available
135
+ - update_index_when_new_file_is_added
136
+ prompt_improvement:
137
+ read_if_pack_insufficient:
138
+ - prompt-economy.yaml
139
+ do:
140
+ - preserve_user_intent
141
+ - improve_only_as_much_as_needed
142
+ - keep_prompt_proportional_to_risk
143
+ - avoid_long_specs_for_simple_tasks
144
+ context_optimization:
145
+ read_if_pack_insufficient:
146
+ - persistent-context.yaml
147
+ - context-rules.yaml
148
+ - context-compiler.yaml
149
+ do:
150
+ - use_context_map_and_aliases_as_pointers
151
+ - read_atomic_subject_doc_before_broad_doc
152
+ - search_with_rg_before_full_file_reads
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
@@ -1,6 +1,6 @@
1
1
  id: protocol_router
2
2
  type: read_router
3
- version: 0.1
3
+ version: 0.3
4
4
  purpose: choose_minimum_protocol_files_by_task
5
5
  default_read:
6
6
  - fast-path.yaml
@@ -93,9 +93,33 @@ 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
96
116
  rules:
97
117
  - start_with_default_read
98
118
  - choose_one_route_if_task_type_is_clear
119
+ - read_route_pack_before_full_route_files_when_available
120
+ - expand_from_route_pack_only_when_needed
121
+ - apply_context_budget_to_selected_route
122
+ - retrieve_only_matching_memory_subjects
99
123
  - if_route_unclear_read_risk_levels_then_choose_route
100
124
  - do_not_read_docs_unless_protocol_is_insufficient
101
125
  - 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.1
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
@@ -0,0 +1,64 @@
1
+ {
2
+ "protocol_files": [
3
+ "README.yaml",
4
+ "fast-path.yaml",
5
+ "router.yaml",
6
+ "route-packs.yaml",
7
+ "modes.yaml",
8
+ "execution-rules.yaml",
9
+ "risk-levels.yaml",
10
+ "mapping-checklists.yaml",
11
+ "validation-checklist.yaml",
12
+ "selective-validation.yaml",
13
+ "context-rules.yaml",
14
+ "context-compiler.yaml",
15
+ "context-budget.yaml",
16
+ "persistent-context.yaml",
17
+ "adaptive-memory.yaml",
18
+ "formatting-rules.yaml",
19
+ "prompt-economy.yaml",
20
+ "spec-driven.yaml"
21
+ ],
22
+ "required_files": [
23
+ "AGENTS.md",
24
+ ".aiignore",
25
+ "canonical-state.yaml",
26
+ "context-map.yaml",
27
+ "decisions/README.md",
28
+ "memory/INDEX.yaml",
29
+ "candidate-memory/README.md"
30
+ ],
31
+ "aiignore_lines": [
32
+ "results/",
33
+ "benchmarks/generated/",
34
+ "model-runs/generated/",
35
+ "dist/",
36
+ "scripts/__pycache__/",
37
+ "*.pyc"
38
+ ],
39
+ "required_text": {
40
+ "AGENTS.md": [
41
+ "AI_PROTOCOL_BEGIN",
42
+ "protocol/fast-path.yaml",
43
+ "protocol/router.yaml",
44
+ "protocol/route-packs.yaml",
45
+ "Classifique o risco antes de agir"
46
+ ],
47
+ "memory/INDEX.yaml": [
48
+ "memory_index",
49
+ "read_only_matching_subjects"
50
+ ],
51
+ "protocol/adaptive-memory.yaml": [
52
+ "memory_guides_current_request_authorizes",
53
+ "blocked_sensitive"
54
+ ],
55
+ "protocol/context-budget.yaml": [
56
+ "budget_guides_reading",
57
+ "stop_when"
58
+ ],
59
+ "protocol/selective-validation.yaml": [
60
+ "smallest_validation_set",
61
+ "release"
62
+ ]
63
+ }
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-execution-protocol",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
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",
@@ -33,7 +33,9 @@
33
33
  "scripts/install_protocol.py",
34
34
  "scripts/npm_install_protocol.js",
35
35
  "scripts/verify_install.py",
36
+ "install-manifest.json",
36
37
  "protocol/",
38
+ "templates/minimal/",
37
39
  "dist/minimal/"
38
40
  ],
39
41
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  id: protocol_index
2
2
  type: index
3
3
  format: yaml
4
- protocol_version: 0.2.0
4
+ protocol_version: 0.3.0
5
5
  purpose: ai_operational_rules
6
6
  source_docs: ../docs
7
7
  constraints:
@@ -13,6 +13,8 @@ files:
13
13
  purpose: minimum_rules_to_start_any_task
14
14
  - path: router.yaml
15
15
  purpose: choose_minimum_files_to_read_by_task
16
+ - path: route-packs.yaml
17
+ purpose: compact_first_read_before_full_route_files
16
18
  - path: modes.yaml
17
19
  purpose: choose_fast_balanced_or_strict_behavior
18
20
  - path: execution-rules.yaml
@@ -23,12 +25,18 @@ files:
23
25
  purpose: pre_change_maps_by_risk
24
26
  - path: validation-checklist.yaml
25
27
  purpose: validation_and_final_delivery
28
+ - path: selective-validation.yaml
29
+ purpose: choose_smallest_sufficient_validation
26
30
  - path: context-rules.yaml
27
31
  purpose: context_window_file_size_memory
28
32
  - path: context-compiler.yaml
29
33
  purpose: compile_minimum_context_package_and_canonical_state
34
+ - path: context-budget.yaml
35
+ purpose: enforce_context_cost_limits_by_risk
30
36
  - path: persistent-context.yaml
31
37
  purpose: progressive_context_retrieval_with_aliases
38
+ - path: adaptive-memory.yaml
39
+ purpose: maintain_verified_user_and_project_memory
32
40
  - path: formatting-rules.yaml
33
41
  purpose: ai_readable_file_format
34
42
  - path: prompt-economy.yaml
@@ -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