algo-cli-runtime 0.14.0__py3-none-any.whl
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.
- algo_cli/__init__.py +3 -0
- algo_cli/__main__.py +7 -0
- algo_cli/_internal/__init__.py +12 -0
- algo_cli/_internal/policy_chain.py +259 -0
- algo_cli/action_registry.py +1047 -0
- algo_cli/agent_blocks.py +550 -0
- algo_cli/agent_pipeline.py +1457 -0
- algo_cli/agent_threads.py +308 -0
- algo_cli/animations.py +316 -0
- algo_cli/cache_admission.py +209 -0
- algo_cli/capability_mask.py +66 -0
- algo_cli/chat_protocol.py +116 -0
- algo_cli/chatgpt_auth.py +510 -0
- algo_cli/chatgpt_client.py +657 -0
- algo_cli/code_rag.py +479 -0
- algo_cli/config.py +651 -0
- algo_cli/context_budget.py +679 -0
- algo_cli/credential_helpers.py +315 -0
- algo_cli/deliberation.py +29 -0
- algo_cli/display.py +1470 -0
- algo_cli/evals/__init__.py +21 -0
- algo_cli/evals/algorithm_effectiveness.py +560 -0
- algo_cli/evals/competitive_harness_rating.py +702 -0
- algo_cli/evals/cot_quality.py +220 -0
- algo_cli/evals/harness_retrieval_benchmark.py +401 -0
- algo_cli/evals/performance_regression.py +136 -0
- algo_cli/evals/scorecard_grading.py +308 -0
- algo_cli/evals/session_distribution.py +84 -0
- algo_cli/execution_guardrails.py +806 -0
- algo_cli/extensions_manifest.py +84 -0
- algo_cli/git_evidence.py +227 -0
- algo_cli/google_workspace.py +407 -0
- algo_cli/google_workspace_auth.py +523 -0
- algo_cli/harness.py +2587 -0
- algo_cli/identity.py +557 -0
- algo_cli/index_compute_lab.py +228 -0
- algo_cli/inference_harness.py +70 -0
- algo_cli/intelligence/__init__.py +1103 -0
- algo_cli/intelligence/acrobat_config.py +307 -0
- algo_cli/intelligence/acrobat_manifests.py +338 -0
- algo_cli/intelligence/acrobat_models.py +195 -0
- algo_cli/intelligence/acrobat_pipeline.py +295 -0
- algo_cli/intelligence/acrobat_runtime.py +302 -0
- algo_cli/intelligence/acrobat_security.py +261 -0
- algo_cli/intelligence/acrobat_workflows.py +226 -0
- algo_cli/intelligence/actionability.py +165 -0
- algo_cli/intelligence/adversarial_audit.py +136 -0
- algo_cli/intelligence/agent_arena.py +92 -0
- algo_cli/intelligence/agent_benchmark.py +236 -0
- algo_cli/intelligence/agent_runtime.py +171 -0
- algo_cli/intelligence/agents_as_tools.py +70 -0
- algo_cli/intelligence/artifact_binding.py +80 -0
- algo_cli/intelligence/autonomous_engineer.py +1976 -0
- algo_cli/intelligence/backpressure.py +99 -0
- algo_cli/intelligence/bloom_filter.py +186 -0
- algo_cli/intelligence/bonferroni.py +66 -0
- algo_cli/intelligence/boundary_compaction.py +98 -0
- algo_cli/intelligence/catalog_verifier.py +172 -0
- algo_cli/intelligence/cavecrew.py +118 -0
- algo_cli/intelligence/changelog.py +176 -0
- algo_cli/intelligence/checkpoint_resume.py +92 -0
- algo_cli/intelligence/circuit_breaker.py +88 -0
- algo_cli/intelligence/clarification_gate.py +101 -0
- algo_cli/intelligence/code_graph.py +180 -0
- algo_cli/intelligence/coderank.py +97 -0
- algo_cli/intelligence/consistent_hash.py +150 -0
- algo_cli/intelligence/consortium_synthesis.py +139 -0
- algo_cli/intelligence/construction/__init__.py +241 -0
- algo_cli/intelligence/construction/common.py +273 -0
- algo_cli/intelligence/construction/documents.py +496 -0
- algo_cli/intelligence/construction/labor_units.py +1395 -0
- algo_cli/intelligence/construction/payments.py +470 -0
- algo_cli/intelligence/construction/risk.py +784 -0
- algo_cli/intelligence/content_extractor.py +132 -0
- algo_cli/intelligence/context_adaptive.py +102 -0
- algo_cli/intelligence/context_ops.py +95 -0
- algo_cli/intelligence/count_min.py +145 -0
- algo_cli/intelligence/cow_state.py +103 -0
- algo_cli/intelligence/critic_loop.py +119 -0
- algo_cli/intelligence/cross_source.py +113 -0
- algo_cli/intelligence/daemon_mode.py +99 -0
- algo_cli/intelligence/dag_orchestration.py +151 -0
- algo_cli/intelligence/deep_research.py +155 -0
- algo_cli/intelligence/degenerate_detector.py +78 -0
- algo_cli/intelligence/delta_report.py +92 -0
- algo_cli/intelligence/discovery_event_log.py +92 -0
- algo_cli/intelligence/document_ingest.py +298 -0
- algo_cli/intelligence/dual_layer_validate.py +151 -0
- algo_cli/intelligence/echo_fidelity.py +73 -0
- algo_cli/intelligence/ema_tuning.py +104 -0
- algo_cli/intelligence/event_log.py +92 -0
- algo_cli/intelligence/evidence_graph.py +114 -0
- algo_cli/intelligence/extension_host.py +162 -0
- algo_cli/intelligence/extension_manifest.py +115 -0
- algo_cli/intelligence/falsification_suite.py +178 -0
- algo_cli/intelligence/finance/__init__.py +169 -0
- algo_cli/intelligence/finance/anomalies.py +135 -0
- algo_cli/intelligence/finance/ap_ar.py +351 -0
- algo_cli/intelligence/finance/cash.py +162 -0
- algo_cli/intelligence/finance/close.py +332 -0
- algo_cli/intelligence/finance/common.py +244 -0
- algo_cli/intelligence/finance/construction.py +135 -0
- algo_cli/intelligence/finance/controls.py +172 -0
- algo_cli/intelligence/finance/evidence.py +119 -0
- algo_cli/intelligence/finance/exceptions.py +157 -0
- algo_cli/intelligence/finance/reconciliations.py +254 -0
- algo_cli/intelligence/finance/revenue.py +109 -0
- algo_cli/intelligence/finance/tax.py +74 -0
- algo_cli/intelligence/finance/workpapers.py +111 -0
- algo_cli/intelligence/finding_record.py +120 -0
- algo_cli/intelligence/flow_dag.py +267 -0
- algo_cli/intelligence/gatherer.py +223 -0
- algo_cli/intelligence/golden_master.py +98 -0
- algo_cli/intelligence/graph_rag.py +195 -0
- algo_cli/intelligence/group_chat.py +143 -0
- algo_cli/intelligence/hash_dedup.py +145 -0
- algo_cli/intelligence/hyperloglog.py +128 -0
- algo_cli/intelligence/incremental_index.py +316 -0
- algo_cli/intelligence/index_store.py +16 -0
- algo_cli/intelligence/iteration_plan.py +133 -0
- algo_cli/intelligence/kernel_plugins.py +167 -0
- algo_cli/intelligence/lesson_catalog.py +135 -0
- algo_cli/intelligence/llm_fallback.py +169 -0
- algo_cli/intelligence/log2_histogram.py +267 -0
- algo_cli/intelligence/lsp_integration.py +147 -0
- algo_cli/intelligence/memory_evolution.py +117 -0
- algo_cli/intelligence/minhash_lsh.py +182 -0
- algo_cli/intelligence/multi_model_score.py +174 -0
- algo_cli/intelligence/multi_tier_grade.py +211 -0
- algo_cli/intelligence/negative_controls.py +113 -0
- algo_cli/intelligence/numeric_clamp.py +63 -0
- algo_cli/intelligence/occ_editor.py +66 -0
- algo_cli/intelligence/output_normalize.py +112 -0
- algo_cli/intelligence/parallel_delegation.py +98 -0
- algo_cli/intelligence/parallel_fanout.py +104 -0
- algo_cli/intelligence/permission_modes.py +105 -0
- algo_cli/intelligence/pre_push_gate.py +68 -0
- algo_cli/intelligence/prefetch.py +171 -0
- algo_cli/intelligence/process_framework.py +217 -0
- algo_cli/intelligence/project_graph.py +387 -0
- algo_cli/intelligence/query_expansion.py +146 -0
- algo_cli/intelligence/ralph_loop.py +117 -0
- algo_cli/intelligence/rate_limiter.py +153 -0
- algo_cli/intelligence/refactor_transaction.py +94 -0
- algo_cli/intelligence/research_workspace.py +108 -0
- algo_cli/intelligence/retraction_ledger.py +72 -0
- algo_cli/intelligence/saga_pattern.py +88 -0
- algo_cli/intelligence/session_fork.py +100 -0
- algo_cli/intelligence/shadow_editor.py +67 -0
- algo_cli/intelligence/shell_session.py +213 -0
- algo_cli/intelligence/source_registry.py +143 -0
- algo_cli/intelligence/spawn_scales.py +99 -0
- algo_cli/intelligence/stat_stability.py +104 -0
- algo_cli/intelligence/structural_validator.py +148 -0
- algo_cli/intelligence/subagent_spawner.py +111 -0
- algo_cli/intelligence/symmetric_verify.py +70 -0
- algo_cli/intelligence/task_classifier.py +129 -0
- algo_cli/intelligence/team_execution.py +122 -0
- algo_cli/intelligence/tiered_access.py +121 -0
- algo_cli/intelligence/utility_registry.py +159 -0
- algo_cli/intuition_engine.py +560 -0
- algo_cli/intuition_injector.py +82 -0
- algo_cli/kernels/__init__.py +5 -0
- algo_cli/kernels/manifest.py +763 -0
- algo_cli/main.py +3903 -0
- algo_cli/memory_candidates.py +541 -0
- algo_cli/memory_echo_veil.py +394 -0
- algo_cli/memory_runtime.py +112 -0
- algo_cli/model_info.py +548 -0
- algo_cli/model_profile.py +160 -0
- algo_cli/model_routing.py +74 -0
- algo_cli/oneshot.py +331 -0
- algo_cli/perf_telemetry.py +389 -0
- algo_cli/plugins.py +245 -0
- algo_cli/private_event_store.py +654 -0
- algo_cli/quantization/__init__.py +24 -0
- algo_cli/quantization/lloyd_max.py +98 -0
- algo_cli/quantization/turbo_quant.py +308 -0
- algo_cli/reasoning/__init__.py +46 -0
- algo_cli/reasoning/combinatorial.py +356 -0
- algo_cli/reasoning/graph_of_thought.py +297 -0
- algo_cli/reasoning/mcts.py +220 -0
- algo_cli/reasoning/neuro_symbolic.py +250 -0
- algo_cli/reasoning/react.py +246 -0
- algo_cli/reasoning/reflexion.py +225 -0
- algo_cli/reasoning/tree_of_thought.py +241 -0
- algo_cli/reasoning_bridge.py +150 -0
- algo_cli/reconciliation.py +284 -0
- algo_cli/reflex.py +385 -0
- algo_cli/resources/docs/ALGO.md +13958 -0
- algo_cli/resources/docs/algo-cli-algorithm-evidence-contract.md +60 -0
- algo_cli/resources/docs/algo-cli-execution-verification-contract.md +59 -0
- algo_cli/resources/docs/algo-cli-memory-lifecycle-contract.md +72 -0
- algo_cli/resources/docs/harness-extension-cleanup-recommendation.md +41 -0
- algo_cli/resources/docs/index-compute-lab-integration.md +32 -0
- algo_cli/resources/docs/inference-harness-loop-blueprint-2026-06.md +55 -0
- algo_cli/resources/docs/main-split-map.md +35 -0
- algo_cli/resources/docs/privacy-and-context.md +48 -0
- algo_cli/resources/docs/reflex-loop-v0.2.md +354 -0
- algo_cli/resources/skills/README.md +26 -0
- algo_cli/resources/skills/algo-cli.md +59 -0
- algo_cli/resources/skills/edit-file-precision.md +49 -0
- algo_cli/resources/skills/harness-search-first.md +47 -0
- algo_cli/resources/skills/memory-recall-ritual.md +51 -0
- algo_cli/resources/skills/qol-algorithms.md +224 -0
- algo_cli/resources/skills/smart-error-recovery.md +56 -0
- algo_cli/resources/skills/tool-selection-cheatsheet.md +65 -0
- algo_cli/retrieval_algorithms.py +127 -0
- algo_cli/runtime_qos.py +236 -0
- algo_cli/runtime_services.py +320 -0
- algo_cli/session_commands.py +95 -0
- algo_cli/session_mode.py +113 -0
- algo_cli/skills.py +430 -0
- algo_cli/slash_dispatch.py +1265 -0
- algo_cli/small_context.py +206 -0
- algo_cli/spawn_budget.py +89 -0
- algo_cli/task_ledger.py +84 -0
- algo_cli/task_router.py +197 -0
- algo_cli/tool_context.py +94 -0
- algo_cli/tool_contract.py +99 -0
- algo_cli/tool_policy.py +357 -0
- algo_cli/tool_runtime.py +647 -0
- algo_cli/tools.py +3056 -0
- algo_cli/url_scheme.py +174 -0
- algo_cli/verify.py +154 -0
- algo_cli/version_manifest.py +178 -0
- algo_cli/vision_screenshot_verify.py +76 -0
- algo_cli/workspace_resolver.py +68 -0
- algo_cli/x_account.py +209 -0
- algo_cli/xai_auth.py +374 -0
- algo_cli/xai_client.py +600 -0
- algo_cli_runtime-0.14.0.dist-info/METADATA +369 -0
- algo_cli_runtime-0.14.0.dist-info/RECORD +237 -0
- algo_cli_runtime-0.14.0.dist-info/WHEEL +4 -0
- algo_cli_runtime-0.14.0.dist-info/entry_points.txt +3 -0
- algo_cli_runtime-0.14.0.dist-info/licenses/LICENSE +21 -0
- ollama_cli/__init__.py +67 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
"""Manifest and live readiness audit for user-facing Algo CLI kernels.
|
|
2
|
+
|
|
3
|
+
The registry intentionally stores module paths as strings. A kernel manifest is
|
|
4
|
+
discoverable metadata, not a workload launcher. ``preview`` and ``planned``
|
|
5
|
+
actions are descriptive capability IDs; every ``active`` action must also have
|
|
6
|
+
an ActionSpec so the runtime's risk/approval contract is explicit.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import importlib
|
|
12
|
+
from dataclasses import dataclass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class KernelSpec:
|
|
17
|
+
name: str
|
|
18
|
+
description: str
|
|
19
|
+
modules: list[str]
|
|
20
|
+
actions: list[str]
|
|
21
|
+
slash_commands: list[str]
|
|
22
|
+
safety_level: str
|
|
23
|
+
status: str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True)
|
|
27
|
+
class KernelAudit:
|
|
28
|
+
name: str
|
|
29
|
+
declared_status: str
|
|
30
|
+
health: str
|
|
31
|
+
modules_checked: int
|
|
32
|
+
slash_commands_checked: int
|
|
33
|
+
registered_actions: int
|
|
34
|
+
total_actions: int
|
|
35
|
+
issues: tuple[str, ...]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
_KERNELS: tuple[KernelSpec, ...] = (
|
|
39
|
+
KernelSpec(
|
|
40
|
+
name="benchmark",
|
|
41
|
+
description="Benchmark and compare agent/runtime behavior with repeatable evaluation metadata.",
|
|
42
|
+
modules=[
|
|
43
|
+
"algo_cli.intelligence.agent_benchmark",
|
|
44
|
+
"algo_cli.intelligence.agent_arena",
|
|
45
|
+
"algo_cli.evals.harness_retrieval_benchmark",
|
|
46
|
+
"algo_cli.evals.algorithm_effectiveness",
|
|
47
|
+
"algo_cli.evals.competitive_harness_rating",
|
|
48
|
+
],
|
|
49
|
+
actions=[
|
|
50
|
+
"benchmark.compare",
|
|
51
|
+
"benchmark.report",
|
|
52
|
+
"benchmark.algorithm_effectiveness",
|
|
53
|
+
],
|
|
54
|
+
slash_commands=["/harness score", "/harness compare", "/kernel show benchmark"],
|
|
55
|
+
safety_level="low",
|
|
56
|
+
status="active",
|
|
57
|
+
),
|
|
58
|
+
KernelSpec(
|
|
59
|
+
name="repo-intelligence",
|
|
60
|
+
description="Inspect repository structure, project graphs, code search signals, and local GraphRAG context.",
|
|
61
|
+
modules=[
|
|
62
|
+
"algo_cli.intelligence.project_graph",
|
|
63
|
+
"algo_cli.intelligence.graph_rag",
|
|
64
|
+
"algo_cli.intelligence.code_graph",
|
|
65
|
+
"algo_cli.intelligence.coderank",
|
|
66
|
+
],
|
|
67
|
+
actions=["repo.status", "repo.query", "repo.reindex"],
|
|
68
|
+
slash_commands=["/intelligence status", "/intelligence query TERM", "/intel query TERM"],
|
|
69
|
+
safety_level="low",
|
|
70
|
+
status="active",
|
|
71
|
+
),
|
|
72
|
+
KernelSpec(
|
|
73
|
+
name="harness-lexical-index",
|
|
74
|
+
description="Build and query a first-stage lexical harness index, starting with SQLite FTS5 and leaving Tantivy as a Rust-side upgrade path.",
|
|
75
|
+
modules=[
|
|
76
|
+
"algo_cli.harness",
|
|
77
|
+
"algo_cli.code_rag",
|
|
78
|
+
"algo_cli.intelligence.index_store",
|
|
79
|
+
],
|
|
80
|
+
actions=["harness.lexical.build", "harness.lexical.query"],
|
|
81
|
+
slash_commands=["/kernel show harness-lexical-index"],
|
|
82
|
+
safety_level="low",
|
|
83
|
+
status="planned",
|
|
84
|
+
),
|
|
85
|
+
KernelSpec(
|
|
86
|
+
name="harness-vector-ann",
|
|
87
|
+
description="Build and query an approximate-nearest-neighbor sidecar for harness embeddings, with the current NumPy scorer as fallback.",
|
|
88
|
+
modules=[
|
|
89
|
+
"algo_cli.harness",
|
|
90
|
+
"algo_cli.code_rag",
|
|
91
|
+
"algo_cli.intelligence.index_store",
|
|
92
|
+
],
|
|
93
|
+
actions=["harness.vector.build", "harness.vector.query"],
|
|
94
|
+
slash_commands=["/kernel show harness-vector-ann"],
|
|
95
|
+
safety_level="low",
|
|
96
|
+
status="planned",
|
|
97
|
+
),
|
|
98
|
+
KernelSpec(
|
|
99
|
+
name="harness-fusion-ranker",
|
|
100
|
+
description="Rank with BM25, fuse exact-vector evidence with RRF, and expose component provenance.",
|
|
101
|
+
modules=[
|
|
102
|
+
"algo_cli.harness",
|
|
103
|
+
"algo_cli.retrieval_algorithms",
|
|
104
|
+
"algo_cli.intelligence.query_expansion",
|
|
105
|
+
],
|
|
106
|
+
actions=["harness.fusion.lexical_rank", "harness.fusion.rank", "harness.fusion.explain"],
|
|
107
|
+
slash_commands=["/kernel show harness-fusion-ranker"],
|
|
108
|
+
safety_level="low",
|
|
109
|
+
status="active",
|
|
110
|
+
),
|
|
111
|
+
KernelSpec(
|
|
112
|
+
name="harness-context-pack",
|
|
113
|
+
description="Pack ranked harness results with MMR-style deduplication and token-budget selection before model context injection.",
|
|
114
|
+
modules=[
|
|
115
|
+
"algo_cli.harness",
|
|
116
|
+
"algo_cli.context_budget",
|
|
117
|
+
"algo_cli.intelligence.context_ops",
|
|
118
|
+
],
|
|
119
|
+
actions=["harness.context.pack", "harness.context.explain"],
|
|
120
|
+
slash_commands=["/kernel show harness-context-pack"],
|
|
121
|
+
safety_level="low",
|
|
122
|
+
status="planned",
|
|
123
|
+
),
|
|
124
|
+
KernelSpec(
|
|
125
|
+
name="harness-incremental-index",
|
|
126
|
+
description="Reuse unchanged harness records and content-identical code chunk embeddings before rebuilding changed sidecars.",
|
|
127
|
+
modules=[
|
|
128
|
+
"algo_cli.harness",
|
|
129
|
+
"algo_cli.code_rag",
|
|
130
|
+
"algo_cli.intelligence.index_store",
|
|
131
|
+
],
|
|
132
|
+
actions=["harness.index.refresh_changed", "harness.index.status"],
|
|
133
|
+
slash_commands=["/kernel show harness-incremental-index"],
|
|
134
|
+
safety_level="medium",
|
|
135
|
+
status="active",
|
|
136
|
+
),
|
|
137
|
+
KernelSpec(
|
|
138
|
+
name="harness-rerank",
|
|
139
|
+
description="Optionally rerank bounded top-N harness candidates with a cross-encoder or local scoring model after cheap retrieval.",
|
|
140
|
+
modules=[
|
|
141
|
+
"algo_cli.harness",
|
|
142
|
+
"algo_cli.intelligence.query_expansion",
|
|
143
|
+
],
|
|
144
|
+
actions=["harness.rerank.candidates", "harness.rerank.explain"],
|
|
145
|
+
slash_commands=["/kernel show harness-rerank"],
|
|
146
|
+
safety_level="low",
|
|
147
|
+
status="planned",
|
|
148
|
+
),
|
|
149
|
+
KernelSpec(
|
|
150
|
+
name="review",
|
|
151
|
+
description="Produce structured review findings, risk summaries, and implementation critique signals.",
|
|
152
|
+
modules=[
|
|
153
|
+
"algo_cli.intelligence.critic_loop",
|
|
154
|
+
"algo_cli.intelligence.structural_validator",
|
|
155
|
+
"algo_cli.intelligence.actionability",
|
|
156
|
+
"algo_cli.intelligence.golden_master",
|
|
157
|
+
],
|
|
158
|
+
actions=["review.findings", "review.risk_summary"],
|
|
159
|
+
slash_commands=["/kernel show review"],
|
|
160
|
+
safety_level="low",
|
|
161
|
+
status="preview",
|
|
162
|
+
),
|
|
163
|
+
KernelSpec(
|
|
164
|
+
name="document-ingest",
|
|
165
|
+
description="Normalize and extract content from documents into source records for downstream analysis.",
|
|
166
|
+
modules=[
|
|
167
|
+
"algo_cli.intelligence.document_ingest",
|
|
168
|
+
"algo_cli.intelligence.content_extractor",
|
|
169
|
+
"algo_cli.intelligence.source_registry",
|
|
170
|
+
],
|
|
171
|
+
actions=["document.extract", "document.normalize"],
|
|
172
|
+
slash_commands=["/kernel show document-ingest"],
|
|
173
|
+
safety_level="medium",
|
|
174
|
+
status="preview",
|
|
175
|
+
),
|
|
176
|
+
KernelSpec(
|
|
177
|
+
name="research",
|
|
178
|
+
description="Coordinate source gathering, query expansion, and cross-source research workspace metadata.",
|
|
179
|
+
modules=[
|
|
180
|
+
"algo_cli.intelligence.deep_research",
|
|
181
|
+
"algo_cli.intelligence.cross_source",
|
|
182
|
+
"algo_cli.intelligence.research_workspace",
|
|
183
|
+
"algo_cli.intelligence.query_expansion",
|
|
184
|
+
"algo_cli.intelligence.gatherer",
|
|
185
|
+
],
|
|
186
|
+
actions=["research.gather", "research.synthesize"],
|
|
187
|
+
slash_commands=["/kernel show research"],
|
|
188
|
+
safety_level="medium",
|
|
189
|
+
status="preview",
|
|
190
|
+
),
|
|
191
|
+
KernelSpec(
|
|
192
|
+
name="agent-runtime",
|
|
193
|
+
description="Run traceable pipelines and bounded read-only specialist teams with persistent parent/child handoffs.",
|
|
194
|
+
modules=[
|
|
195
|
+
"algo_cli.agent_pipeline",
|
|
196
|
+
"algo_cli.agent_threads",
|
|
197
|
+
"algo_cli.intelligence.agent_runtime",
|
|
198
|
+
"algo_cli.intelligence.agents_as_tools",
|
|
199
|
+
"algo_cli.intelligence.autonomous_engineer",
|
|
200
|
+
"algo_cli.intelligence.team_execution",
|
|
201
|
+
"algo_cli.intelligence.subagent_spawner",
|
|
202
|
+
],
|
|
203
|
+
actions=["agent.plan", "agent.delegate", "agent.report", "agent.thread.resume"],
|
|
204
|
+
slash_commands=[
|
|
205
|
+
"/agent [--pipeline NAME] TASK",
|
|
206
|
+
"/agent team [--roles A,B[,C,D]] TASK",
|
|
207
|
+
"/agent threads",
|
|
208
|
+
"/kernel show agent-runtime",
|
|
209
|
+
],
|
|
210
|
+
safety_level="medium",
|
|
211
|
+
status="active",
|
|
212
|
+
),
|
|
213
|
+
KernelSpec(
|
|
214
|
+
name="flow-dag",
|
|
215
|
+
description="Represent workflow DAGs, orchestration edges, and saga-style recovery metadata.",
|
|
216
|
+
modules=[
|
|
217
|
+
"algo_cli.intelligence.flow_dag",
|
|
218
|
+
"algo_cli.intelligence.dag_orchestration",
|
|
219
|
+
"algo_cli.intelligence.saga_pattern",
|
|
220
|
+
],
|
|
221
|
+
actions=["flow.describe", "flow.validate"],
|
|
222
|
+
slash_commands=["/kernel show flow-dag"],
|
|
223
|
+
safety_level="low",
|
|
224
|
+
status="preview",
|
|
225
|
+
),
|
|
226
|
+
KernelSpec(
|
|
227
|
+
name="extension",
|
|
228
|
+
description="Describe extension manifests, extension hosts, and kernel plugin metadata.",
|
|
229
|
+
modules=[
|
|
230
|
+
"algo_cli.intelligence.extension_manifest",
|
|
231
|
+
"algo_cli.intelligence.extension_host",
|
|
232
|
+
"algo_cli.intelligence.kernel_plugins",
|
|
233
|
+
],
|
|
234
|
+
actions=["extension.inspect", "extension.validate"],
|
|
235
|
+
slash_commands=["/kernel show extension"],
|
|
236
|
+
safety_level="medium",
|
|
237
|
+
status="preview",
|
|
238
|
+
),
|
|
239
|
+
KernelSpec(
|
|
240
|
+
name="acrobat",
|
|
241
|
+
description="Describe Acrobat pipeline, runtime, workflow, manifest, and security capabilities.",
|
|
242
|
+
modules=[
|
|
243
|
+
"algo_cli.intelligence.acrobat_pipeline",
|
|
244
|
+
"algo_cli.intelligence.acrobat_runtime",
|
|
245
|
+
"algo_cli.intelligence.acrobat_workflows",
|
|
246
|
+
"algo_cli.intelligence.acrobat_config",
|
|
247
|
+
"algo_cli.intelligence.acrobat_security",
|
|
248
|
+
"algo_cli.intelligence.acrobat_models",
|
|
249
|
+
"algo_cli.intelligence.acrobat_manifests",
|
|
250
|
+
],
|
|
251
|
+
actions=["acrobat.inspect", "acrobat.plan"],
|
|
252
|
+
slash_commands=["/kernel show acrobat"],
|
|
253
|
+
safety_level="medium",
|
|
254
|
+
status="preview",
|
|
255
|
+
),
|
|
256
|
+
KernelSpec(
|
|
257
|
+
name="echo-fidelity-guard",
|
|
258
|
+
description="Distinguish None (unmeasured) from 0.0 (measured failure) from valid float — prevents fabrications.",
|
|
259
|
+
modules=["algo_cli.intelligence.echo_fidelity"],
|
|
260
|
+
actions=["guard.echo_fidelity"],
|
|
261
|
+
slash_commands=["/kernel show echo-fidelity-guard"],
|
|
262
|
+
safety_level="low",
|
|
263
|
+
status="preview",
|
|
264
|
+
),
|
|
265
|
+
KernelSpec(
|
|
266
|
+
name="numeric-clamp-guard",
|
|
267
|
+
description="Clamp telemetry values to a valid range and record warnings when out-of-range values are encountered.",
|
|
268
|
+
modules=["algo_cli.intelligence.numeric_clamp"],
|
|
269
|
+
actions=["guard.numeric_clamp"],
|
|
270
|
+
slash_commands=["/kernel show numeric-clamp-guard"],
|
|
271
|
+
safety_level="low",
|
|
272
|
+
status="preview",
|
|
273
|
+
),
|
|
274
|
+
KernelSpec(
|
|
275
|
+
name="ema-tuning",
|
|
276
|
+
description="Feedback-driven parameter tuning via exponential moving average with sample-count gating and bounded history.",
|
|
277
|
+
modules=["algo_cli.intelligence.ema_tuning"],
|
|
278
|
+
actions=["tuning.update", "tuning.apply"],
|
|
279
|
+
slash_commands=["/kernel show ema-tuning"],
|
|
280
|
+
safety_level="low",
|
|
281
|
+
status="preview",
|
|
282
|
+
),
|
|
283
|
+
KernelSpec(
|
|
284
|
+
name="bonferroni-guard",
|
|
285
|
+
description="Bonferroni correction for multiple comparisons — prevents false discoveries when running many tests.",
|
|
286
|
+
modules=["algo_cli.intelligence.bonferroni"],
|
|
287
|
+
actions=["guard.bonferroni"],
|
|
288
|
+
slash_commands=["/kernel show bonferroni-guard"],
|
|
289
|
+
safety_level="low",
|
|
290
|
+
status="preview",
|
|
291
|
+
),
|
|
292
|
+
KernelSpec(
|
|
293
|
+
name="pre-push-gate",
|
|
294
|
+
description="Hard-block raw pushes of private working tree; require explicit env var override or scrubbed export path.",
|
|
295
|
+
modules=["algo_cli.intelligence.pre_push_gate"],
|
|
296
|
+
actions=["gate.pre_push"],
|
|
297
|
+
slash_commands=["/kernel show pre-push-gate"],
|
|
298
|
+
safety_level="medium",
|
|
299
|
+
status="preview",
|
|
300
|
+
),
|
|
301
|
+
# --- Phase 2: Medium deterministic kernels (H1, H3, H4, H9, H11) ---
|
|
302
|
+
KernelSpec(
|
|
303
|
+
name="finding-record",
|
|
304
|
+
description="Structured append-only finding records with provenance, severity, and lifecycle tracking.",
|
|
305
|
+
modules=["algo_cli.intelligence.finding_record"],
|
|
306
|
+
actions=["finding.create", "finding.query", "finding.update"],
|
|
307
|
+
slash_commands=["/kernel show finding-record"],
|
|
308
|
+
safety_level="low",
|
|
309
|
+
status="preview",
|
|
310
|
+
),
|
|
311
|
+
KernelSpec(
|
|
312
|
+
name="retraction-ledger",
|
|
313
|
+
description="Append-only retraction records — never silent deletes, always leave a trace.",
|
|
314
|
+
modules=["algo_cli.intelligence.retraction_ledger"],
|
|
315
|
+
actions=["retraction.add", "retraction.list"],
|
|
316
|
+
slash_commands=["/kernel show retraction-ledger"],
|
|
317
|
+
safety_level="low",
|
|
318
|
+
status="preview",
|
|
319
|
+
),
|
|
320
|
+
KernelSpec(
|
|
321
|
+
name="discovery-event-log",
|
|
322
|
+
description="Structured events for the full discovery lifecycle: discovered, proposed, verified, retracted.",
|
|
323
|
+
modules=["algo_cli.intelligence.event_log"],
|
|
324
|
+
actions=["event.emit", "event.query"],
|
|
325
|
+
slash_commands=["/kernel show discovery-event-log"],
|
|
326
|
+
safety_level="low",
|
|
327
|
+
status="preview",
|
|
328
|
+
),
|
|
329
|
+
KernelSpec(
|
|
330
|
+
name="artifact-binding",
|
|
331
|
+
description="Bind every claim to a raw artifact with content hash for provenance verification.",
|
|
332
|
+
modules=["algo_cli.intelligence.artifact_binding"],
|
|
333
|
+
actions=["binding.bind", "binding.verify"],
|
|
334
|
+
slash_commands=["/kernel show artifact-binding"],
|
|
335
|
+
safety_level="low",
|
|
336
|
+
status="preview",
|
|
337
|
+
),
|
|
338
|
+
KernelSpec(
|
|
339
|
+
name="checkpoint-resume",
|
|
340
|
+
description="Resumable long catalog operations via state serialization and checkpoint recovery.",
|
|
341
|
+
modules=["algo_cli.intelligence.checkpoint_resume"],
|
|
342
|
+
actions=["checkpoint.save", "checkpoint.load", "checkpoint.list"],
|
|
343
|
+
slash_commands=["/kernel show checkpoint-resume"],
|
|
344
|
+
safety_level="low",
|
|
345
|
+
status="preview",
|
|
346
|
+
),
|
|
347
|
+
# --- Phase 2: Medium deterministic kernels (H14, H16, H17, H19, H21, H22, H27, H30, H31, H2) ---
|
|
348
|
+
KernelSpec(
|
|
349
|
+
name="symmetric-verify",
|
|
350
|
+
description="Every creator pattern needs a verifier companion — graph analysis of encode/decode pairs.",
|
|
351
|
+
modules=["algo_cli.intelligence.symmetric_verify"],
|
|
352
|
+
actions=["verify.symmetric"],
|
|
353
|
+
slash_commands=["/kernel show symmetric-verify"],
|
|
354
|
+
safety_level="low",
|
|
355
|
+
status="preview",
|
|
356
|
+
),
|
|
357
|
+
KernelSpec(
|
|
358
|
+
name="circuit-breaker",
|
|
359
|
+
description="Accumulate risk per failure, auto-disable at threshold — prevents cascading failures.",
|
|
360
|
+
modules=["algo_cli.intelligence.circuit_breaker"],
|
|
361
|
+
actions=["breaker.check", "breaker.reset", "breaker.record"],
|
|
362
|
+
slash_commands=["/kernel show circuit-breaker"],
|
|
363
|
+
safety_level="low",
|
|
364
|
+
status="preview",
|
|
365
|
+
),
|
|
366
|
+
KernelSpec(
|
|
367
|
+
name="negative-controls",
|
|
368
|
+
description="Known-clean samples to measure false positive rate — confusion matrix for catalog verification.",
|
|
369
|
+
modules=["algo_cli.intelligence.negative_controls"],
|
|
370
|
+
actions=["verify.negative_controls"],
|
|
371
|
+
slash_commands=["/kernel show negative-controls"],
|
|
372
|
+
safety_level="low",
|
|
373
|
+
status="preview",
|
|
374
|
+
),
|
|
375
|
+
KernelSpec(
|
|
376
|
+
name="stat-stability-guard",
|
|
377
|
+
description="Warn when sample sizes are too small for stable results — t-distribution CI calculation.",
|
|
378
|
+
modules=["algo_cli.intelligence.stat_stability"],
|
|
379
|
+
actions=["guard.stat_stability"],
|
|
380
|
+
slash_commands=["/kernel show stat-stability-guard"],
|
|
381
|
+
safety_level="low",
|
|
382
|
+
status="preview",
|
|
383
|
+
),
|
|
384
|
+
KernelSpec(
|
|
385
|
+
name="context-adaptive",
|
|
386
|
+
description="Classify context via weighted pattern scoring, then select parameters before execution.",
|
|
387
|
+
modules=["algo_cli.intelligence.context_adaptive"],
|
|
388
|
+
actions=["tuning.detect_context"],
|
|
389
|
+
slash_commands=["/kernel show context-adaptive"],
|
|
390
|
+
safety_level="low",
|
|
391
|
+
status="preview",
|
|
392
|
+
),
|
|
393
|
+
KernelSpec(
|
|
394
|
+
name="output-normalize",
|
|
395
|
+
description="Toggleable pipeline stages for sequential output normalization (hedge reduction, direct mode, casual mode).",
|
|
396
|
+
modules=["algo_cli.intelligence.output_normalize"],
|
|
397
|
+
actions=["normalize.output"],
|
|
398
|
+
slash_commands=["/kernel show output-normalize"],
|
|
399
|
+
safety_level="low",
|
|
400
|
+
status="preview",
|
|
401
|
+
),
|
|
402
|
+
KernelSpec(
|
|
403
|
+
name="degenerate-detector",
|
|
404
|
+
description="Detect solutions that precompute answers without required control flow (loops, functions, conditionals).",
|
|
405
|
+
modules=["algo_cli.intelligence.degenerate_detector"],
|
|
406
|
+
actions=["verify.degenerate"],
|
|
407
|
+
slash_commands=["/kernel show degenerate-detector"],
|
|
408
|
+
safety_level="low",
|
|
409
|
+
status="preview",
|
|
410
|
+
),
|
|
411
|
+
KernelSpec(
|
|
412
|
+
name="delta-report",
|
|
413
|
+
description="Report what changed since last assessment — set operations on old vs new state with priority classification.",
|
|
414
|
+
modules=["algo_cli.intelligence.delta_report"],
|
|
415
|
+
actions=["report.delta"],
|
|
416
|
+
slash_commands=["/kernel show delta-report"],
|
|
417
|
+
safety_level="low",
|
|
418
|
+
status="preview",
|
|
419
|
+
),
|
|
420
|
+
KernelSpec(
|
|
421
|
+
name="tiered-access-gate",
|
|
422
|
+
description="Tiered tool access: default (always granted), opt-in (env var gated), approval-gated (env var + human approval).",
|
|
423
|
+
modules=["algo_cli.intelligence.tiered_access"],
|
|
424
|
+
actions=["gate.check_access"],
|
|
425
|
+
slash_commands=["/kernel show tiered-access-gate"],
|
|
426
|
+
safety_level="medium",
|
|
427
|
+
status="preview",
|
|
428
|
+
),
|
|
429
|
+
KernelSpec(
|
|
430
|
+
name="catalog-verifier",
|
|
431
|
+
description="Re-derive every 'implemented' status from live tests — parse ALGO.md, run tests, report discrepancies.",
|
|
432
|
+
modules=["algo_cli.intelligence.catalog_verifier"],
|
|
433
|
+
actions=["catalog.verify"],
|
|
434
|
+
slash_commands=["/kernel show catalog-verifier"],
|
|
435
|
+
safety_level="low",
|
|
436
|
+
status="preview",
|
|
437
|
+
),
|
|
438
|
+
KernelSpec(
|
|
439
|
+
name="lesson-catalog-propose",
|
|
440
|
+
description="Scan lesson text for algorithmic patterns and propose new catalog entries.",
|
|
441
|
+
modules=["algo_cli.intelligence.lesson_catalog"],
|
|
442
|
+
actions=["propose.lesson_catalog"],
|
|
443
|
+
slash_commands=["/kernel show lesson-catalog-propose"],
|
|
444
|
+
safety_level="medium",
|
|
445
|
+
status="preview",
|
|
446
|
+
),
|
|
447
|
+
KernelSpec(
|
|
448
|
+
name="adversarial-audit",
|
|
449
|
+
description="Run tests and compare claimed vs actual behavior to catch fabricated or exaggerated claims.",
|
|
450
|
+
modules=["algo_cli.intelligence.adversarial_audit"],
|
|
451
|
+
actions=["audit.adversarial"],
|
|
452
|
+
slash_commands=["/kernel show adversarial-audit"],
|
|
453
|
+
safety_level="medium",
|
|
454
|
+
status="preview",
|
|
455
|
+
),
|
|
456
|
+
KernelSpec(
|
|
457
|
+
name="multi-model-score",
|
|
458
|
+
description="Score algorithm candidates across a panel of models and pick the winner.",
|
|
459
|
+
modules=["algo_cli.intelligence.multi_model_score"],
|
|
460
|
+
actions=["score.multi_model"],
|
|
461
|
+
slash_commands=["/kernel show multi-model-score"],
|
|
462
|
+
safety_level="medium",
|
|
463
|
+
status="preview",
|
|
464
|
+
),
|
|
465
|
+
KernelSpec(
|
|
466
|
+
name="llm-fallback-chain",
|
|
467
|
+
description="Resilient LLM call with primary → fallback model → 3-tier JSON parsing.",
|
|
468
|
+
modules=["algo_cli.intelligence.llm_fallback"],
|
|
469
|
+
actions=["guard.llm_fallback"],
|
|
470
|
+
slash_commands=["/kernel show llm-fallback-chain"],
|
|
471
|
+
safety_level="low",
|
|
472
|
+
status="preview",
|
|
473
|
+
),
|
|
474
|
+
KernelSpec(
|
|
475
|
+
name="dual-layer-validate",
|
|
476
|
+
description="Two-layer validation: validator probes check claims, independent skeptic attempts refutation.",
|
|
477
|
+
modules=["algo_cli.intelligence.dual_layer_validate"],
|
|
478
|
+
actions=["validate.dual_layer"],
|
|
479
|
+
slash_commands=["/kernel show dual-layer-validate"],
|
|
480
|
+
safety_level="medium",
|
|
481
|
+
status="preview",
|
|
482
|
+
),
|
|
483
|
+
KernelSpec(
|
|
484
|
+
name="falsification-suite",
|
|
485
|
+
description="Multiple independent probes (S1–S4) that attack a claim from different angles.",
|
|
486
|
+
modules=["algo_cli.intelligence.falsification_suite"],
|
|
487
|
+
actions=["validate.falsification"],
|
|
488
|
+
slash_commands=["/kernel show falsification-suite"],
|
|
489
|
+
safety_level="medium",
|
|
490
|
+
status="preview",
|
|
491
|
+
),
|
|
492
|
+
KernelSpec(
|
|
493
|
+
name="consortium-synthesis",
|
|
494
|
+
description="Synthesize ground truth from all model responses — ground truth over popularity, specificity wins.",
|
|
495
|
+
modules=["algo_cli.intelligence.consortium_synthesis"],
|
|
496
|
+
actions=["synthesize.consortium"],
|
|
497
|
+
slash_commands=["/kernel show consortium-synthesis"],
|
|
498
|
+
safety_level="medium",
|
|
499
|
+
status="preview",
|
|
500
|
+
),
|
|
501
|
+
KernelSpec(
|
|
502
|
+
name="multi-tier-grade",
|
|
503
|
+
description="Three grading tiers: strict (unforgiving), lenient (surface recovery), structured (requires constructs).",
|
|
504
|
+
modules=["algo_cli.intelligence.multi_tier_grade"],
|
|
505
|
+
actions=["grade.multi_tier"],
|
|
506
|
+
slash_commands=["/kernel show multi-tier-grade"],
|
|
507
|
+
safety_level="low",
|
|
508
|
+
status="preview",
|
|
509
|
+
),
|
|
510
|
+
# --- Phase 4: Pattern-derived kernels (Fable-5 corpus + macOS /System audit) ---
|
|
511
|
+
KernelSpec(
|
|
512
|
+
name="policy-chain",
|
|
513
|
+
description="PAM-style policy chain: ordered checks with control flags (required / sufficient / requisite / include). Upgrade of tool_policy.py from a single boolean to a composable, audit-trail-preserving decision model.",
|
|
514
|
+
modules=[
|
|
515
|
+
"algo_cli._internal.policy_chain",
|
|
516
|
+
"algo_cli.tool_policy",
|
|
517
|
+
],
|
|
518
|
+
actions=["chain.evaluate", "chain.audit"],
|
|
519
|
+
slash_commands=["/kernel show policy-chain"],
|
|
520
|
+
safety_level="medium",
|
|
521
|
+
status="active",
|
|
522
|
+
),
|
|
523
|
+
KernelSpec(
|
|
524
|
+
name="cot-quality-scorer",
|
|
525
|
+
description="Score CoT blocks on sequencing markers, length ratio, and verification cadence. Flags under-thinking, over-thinking, and stream-of-consciousness reasoning. Calibrated against the Fable-5 corpus (4,665 rows; median cot_ratio = 1.14).",
|
|
526
|
+
modules=["algo_cli.evals.cot_quality"],
|
|
527
|
+
actions=["cot.score"],
|
|
528
|
+
slash_commands=["/kernel show cot-quality-scorer"],
|
|
529
|
+
safety_level="low",
|
|
530
|
+
status="preview",
|
|
531
|
+
),
|
|
532
|
+
KernelSpec(
|
|
533
|
+
name="bash-description-discipline",
|
|
534
|
+
description="Require a non-empty description field on every Bash tool call. 100% of Bash calls in the Fable-5 corpus (1544/1544) had descriptions; replicate the discipline as a tool gate.",
|
|
535
|
+
modules=["algo_cli.tools"],
|
|
536
|
+
actions=["bash.validate_description"],
|
|
537
|
+
slash_commands=["/kernel show bash-description-discipline"],
|
|
538
|
+
safety_level="low",
|
|
539
|
+
status="preview",
|
|
540
|
+
),
|
|
541
|
+
KernelSpec(
|
|
542
|
+
name="screenshot-verification",
|
|
543
|
+
description="Turn vision screenshot descriptions into structured expected/forbidden UI evidence checks.",
|
|
544
|
+
modules=["algo_cli.vision_screenshot_verify", "algo_cli.tools"],
|
|
545
|
+
actions=["vision.screenshot_verify"],
|
|
546
|
+
slash_commands=["/kernel show screenshot-verification"],
|
|
547
|
+
safety_level="low",
|
|
548
|
+
status="active",
|
|
549
|
+
),
|
|
550
|
+
KernelSpec(
|
|
551
|
+
name="tool-sequence-tdd",
|
|
552
|
+
description="Detect healthy Edit→Bash→Edit and verification-after-edit tool cadences from Fable-5 traces.",
|
|
553
|
+
modules=["algo_cli.evals.cot_quality"],
|
|
554
|
+
actions=["tool_sequence.score"],
|
|
555
|
+
slash_commands=["/kernel show tool-sequence-tdd"],
|
|
556
|
+
safety_level="low",
|
|
557
|
+
status="active",
|
|
558
|
+
),
|
|
559
|
+
KernelSpec(
|
|
560
|
+
name="session-distribution",
|
|
561
|
+
description="Summarize session row distributions and flag heavy-tail concentration risk.",
|
|
562
|
+
modules=["algo_cli.evals.session_distribution", "algo_cli.harness"],
|
|
563
|
+
actions=["session_distribution.summarize"],
|
|
564
|
+
slash_commands=["/kernel show session-distribution"],
|
|
565
|
+
safety_level="low",
|
|
566
|
+
status="active",
|
|
567
|
+
),
|
|
568
|
+
KernelSpec(
|
|
569
|
+
name="runtime-qos",
|
|
570
|
+
description="Classify runtime posture, attach named logs, and deterministically order bounded tool batches.",
|
|
571
|
+
modules=["algo_cli.runtime_qos", "algo_cli.harness", "algo_cli.tools"],
|
|
572
|
+
actions=["runtime.qos.classify", "runtime.qos.schedule", "runtime.log_path"],
|
|
573
|
+
slash_commands=["/kernel show runtime-qos"],
|
|
574
|
+
safety_level="low",
|
|
575
|
+
status="active",
|
|
576
|
+
),
|
|
577
|
+
KernelSpec(
|
|
578
|
+
name="window-tinylfu",
|
|
579
|
+
description="Bounded Window TinyLFU admission for harness and identity query-embedding caches.",
|
|
580
|
+
modules=["algo_cli.cache_admission", "algo_cli.harness", "algo_cli.identity"],
|
|
581
|
+
actions=["cache.tinylfu.admit", "cache.tinylfu.stats"],
|
|
582
|
+
slash_commands=["/kernel show window-tinylfu"],
|
|
583
|
+
safety_level="low",
|
|
584
|
+
status="active",
|
|
585
|
+
),
|
|
586
|
+
KernelSpec(
|
|
587
|
+
name="performance-cusum",
|
|
588
|
+
description="Detect sustained comparable-series latency shifts and report them through /selfcheck.",
|
|
589
|
+
modules=["algo_cli.evals.performance_regression", "algo_cli.perf_telemetry"],
|
|
590
|
+
actions=["performance.cusum.detect", "performance.cusum.selfcheck"],
|
|
591
|
+
slash_commands=["/selfcheck", "/kernel show performance-cusum"],
|
|
592
|
+
safety_level="low",
|
|
593
|
+
status="active",
|
|
594
|
+
),
|
|
595
|
+
KernelSpec(
|
|
596
|
+
name="capability-mask",
|
|
597
|
+
description="Stable numeric capability bit masks for tool/kernel tiers, inspired by macOS audit_class.",
|
|
598
|
+
modules=["algo_cli.capability_mask", "algo_cli.tool_policy"],
|
|
599
|
+
actions=["capability.mask", "capability.tier"],
|
|
600
|
+
slash_commands=["/kernel show capability-mask"],
|
|
601
|
+
safety_level="low",
|
|
602
|
+
status="active",
|
|
603
|
+
),
|
|
604
|
+
KernelSpec(
|
|
605
|
+
name="extensions-manifest",
|
|
606
|
+
description="SystemVersion-style extension manifest for plugins and helper binaries.",
|
|
607
|
+
modules=["algo_cli.extensions_manifest", "algo_cli.version_manifest", "algo_cli.tools"],
|
|
608
|
+
actions=["extensions.manifest"],
|
|
609
|
+
slash_commands=["/kernel show extensions-manifest"],
|
|
610
|
+
safety_level="low",
|
|
611
|
+
status="active",
|
|
612
|
+
),
|
|
613
|
+
KernelSpec(
|
|
614
|
+
name="small-context-ledger",
|
|
615
|
+
description="For models with runtime context below 75k, write full optional context to a temp ledger file and inject a compact refresh trigger so small models can regain context on demand.",
|
|
616
|
+
modules=["algo_cli.small_context", "algo_cli.context_budget", "algo_cli.main", "algo_cli.tools"],
|
|
617
|
+
actions=["small_context.ledger.write", "small_context.ledger.preview"],
|
|
618
|
+
slash_commands=["/kernel show small-context-ledger"],
|
|
619
|
+
safety_level="low",
|
|
620
|
+
status="active",
|
|
621
|
+
),
|
|
622
|
+
)
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
def _copy_spec(spec: KernelSpec) -> KernelSpec:
|
|
626
|
+
return KernelSpec(
|
|
627
|
+
name=spec.name,
|
|
628
|
+
description=spec.description,
|
|
629
|
+
modules=list(spec.modules),
|
|
630
|
+
actions=list(spec.actions),
|
|
631
|
+
slash_commands=list(spec.slash_commands),
|
|
632
|
+
safety_level=spec.safety_level,
|
|
633
|
+
status=spec.status,
|
|
634
|
+
)
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
def list_kernels() -> list[KernelSpec]:
|
|
638
|
+
return [_copy_spec(spec) for spec in _KERNELS]
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
def get_kernel(name: str) -> KernelSpec | None:
|
|
642
|
+
normalized = (name or "").strip().lower()
|
|
643
|
+
for spec in _KERNELS:
|
|
644
|
+
if spec.name == normalized:
|
|
645
|
+
return _copy_spec(spec)
|
|
646
|
+
return None
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
def kernel_names() -> list[str]:
|
|
650
|
+
return [spec.name for spec in _KERNELS]
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
def audit_kernel(spec: KernelSpec) -> KernelAudit:
|
|
654
|
+
"""Validate imports, slash roots, metadata, and declared action contracts.
|
|
655
|
+
|
|
656
|
+
This is a declaration audit, not a dry-run execution probe.
|
|
657
|
+
"""
|
|
658
|
+
|
|
659
|
+
from ..action_registry import list_action_specs
|
|
660
|
+
from ..slash_dispatch import SLASH_COMMANDS
|
|
661
|
+
|
|
662
|
+
issues: list[str] = []
|
|
663
|
+
if spec.status not in {"planned", "preview", "active"}:
|
|
664
|
+
issues.append(f"invalid status: {spec.status}")
|
|
665
|
+
if spec.safety_level not in {"low", "medium", "high"}:
|
|
666
|
+
issues.append(f"invalid safety level: {spec.safety_level}")
|
|
667
|
+
if len(spec.modules) != len(set(spec.modules)):
|
|
668
|
+
issues.append("duplicate module declarations")
|
|
669
|
+
if len(spec.actions) != len(set(spec.actions)):
|
|
670
|
+
issues.append("duplicate action declarations")
|
|
671
|
+
if len(spec.slash_commands) != len(set(spec.slash_commands)):
|
|
672
|
+
issues.append("duplicate slash command declarations")
|
|
673
|
+
|
|
674
|
+
for module_path in spec.modules:
|
|
675
|
+
try:
|
|
676
|
+
importlib.import_module(module_path)
|
|
677
|
+
except Exception as exc:
|
|
678
|
+
issues.append(f"module {module_path}: {type(exc).__name__}: {exc}")
|
|
679
|
+
|
|
680
|
+
slash_roots = {command.split()[0] for command, _description in SLASH_COMMANDS}
|
|
681
|
+
for command in spec.slash_commands:
|
|
682
|
+
root = command.split()[0] if command.split() else ""
|
|
683
|
+
if root not in slash_roots:
|
|
684
|
+
issues.append(f"slash root is not registered: {command}")
|
|
685
|
+
|
|
686
|
+
action_specs = {
|
|
687
|
+
action.name
|
|
688
|
+
for action in list_action_specs(include_archived=False)
|
|
689
|
+
if action.kind == "kernel"
|
|
690
|
+
}
|
|
691
|
+
registered = sum(action in action_specs for action in spec.actions)
|
|
692
|
+
if spec.status == "active":
|
|
693
|
+
missing = [action for action in spec.actions if action not in action_specs]
|
|
694
|
+
if missing:
|
|
695
|
+
issues.append(f"active actions missing ActionSpec: {', '.join(missing)}")
|
|
696
|
+
|
|
697
|
+
health = "blocked" if issues else "ready" if spec.status == "active" else spec.status
|
|
698
|
+
return KernelAudit(
|
|
699
|
+
name=spec.name,
|
|
700
|
+
declared_status=spec.status,
|
|
701
|
+
health=health,
|
|
702
|
+
modules_checked=len(spec.modules),
|
|
703
|
+
slash_commands_checked=len(spec.slash_commands),
|
|
704
|
+
registered_actions=registered,
|
|
705
|
+
total_actions=len(spec.actions),
|
|
706
|
+
issues=tuple(issues),
|
|
707
|
+
)
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
def audit_kernels(name: str | None = None) -> list[KernelAudit]:
|
|
711
|
+
"""Audit one kernel or the full manifest without executing workloads."""
|
|
712
|
+
|
|
713
|
+
if name:
|
|
714
|
+
spec = get_kernel(name)
|
|
715
|
+
if spec is None:
|
|
716
|
+
raise KeyError(f"Unknown kernel: {name}")
|
|
717
|
+
return [audit_kernel(spec)]
|
|
718
|
+
return [audit_kernel(spec) for spec in list_kernels()]
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
def render_kernel_audit(audits: list[KernelAudit]) -> str:
|
|
722
|
+
blocked = sum(audit.health == "blocked" for audit in audits)
|
|
723
|
+
ready = sum(audit.health == "ready" for audit in audits)
|
|
724
|
+
preview = sum(audit.health == "preview" for audit in audits)
|
|
725
|
+
planned = sum(audit.health == "planned" for audit in audits)
|
|
726
|
+
lines = [
|
|
727
|
+
f"Kernel audit: {len(audits)} checked · {ready} ready · {preview} preview · "
|
|
728
|
+
f"{planned} planned · {blocked} blocked"
|
|
729
|
+
]
|
|
730
|
+
if len(audits) > 1:
|
|
731
|
+
ready_names = [audit.name for audit in audits if audit.health == "ready"]
|
|
732
|
+
if ready_names:
|
|
733
|
+
lines.append(
|
|
734
|
+
"- active contract-ready (imports, slash roots, and action declarations): "
|
|
735
|
+
f"{', '.join(ready_names)}"
|
|
736
|
+
)
|
|
737
|
+
if preview:
|
|
738
|
+
lines.append(
|
|
739
|
+
f"- {preview} preview kernels: modules and slash routes resolve; "
|
|
740
|
+
"unregistered actions remain descriptive"
|
|
741
|
+
)
|
|
742
|
+
if planned:
|
|
743
|
+
lines.append(f"- {planned} planned kernels: contracts resolve but are not active runtime surfaces")
|
|
744
|
+
for audit in audits:
|
|
745
|
+
if audit.health != "blocked":
|
|
746
|
+
continue
|
|
747
|
+
lines.append(f"- {audit.name}: blocked")
|
|
748
|
+
lines.extend(f" issue: {issue}" for issue in audit.issues)
|
|
749
|
+
lines.append("Use /kernel check NAME for per-kernel action coverage and details.")
|
|
750
|
+
return "\n".join(lines)
|
|
751
|
+
for audit in audits:
|
|
752
|
+
lines.append(
|
|
753
|
+
f"- {audit.name}: {audit.health} "
|
|
754
|
+
f"({audit.modules_checked} modules, {audit.slash_commands_checked} slash routes, "
|
|
755
|
+
f"{audit.registered_actions}/{audit.total_actions} registered actions)"
|
|
756
|
+
)
|
|
757
|
+
for issue in audit.issues:
|
|
758
|
+
lines.append(f" issue: {issue}")
|
|
759
|
+
if not audit.issues and audit.declared_status != "active" and audit.registered_actions < audit.total_actions:
|
|
760
|
+
lines.append(" note: actions are descriptive until this kernel is promoted to active")
|
|
761
|
+
elif not audit.issues and audit.declared_status == "active":
|
|
762
|
+
lines.append(" note: contract audit passed; workload execution is verified by focused tests")
|
|
763
|
+
return "\n".join(lines)
|