fix(health): suppress 404 when health monitor disabled + fix audit test assertion

- Sidebar.svelte: defer healthStore.refresh() until feature flags confirm
  health_monitor is enabled; skip entirely when disabled
- health.js: remove throw error from catch block — log and return null
  instead, preventing 'Uncaught (in promise)' on expected 404
- test_report_audit_immutability.py: fix mock assertions —
  audit_service uses logger.reason/reflect/explore, not logger.info
- HealthStore and Sidebar now produce zero network noise when
  FEATURES__HEALTH_MONITOR=false
This commit is contained in:
2026-05-17 14:18:02 +03:00
parent 58ac89c21e
commit cd868df261
141 changed files with 9631 additions and 10165 deletions

View File

@@ -1,7 +1,7 @@
---
description: Closure gate subagent that re-audits merged worker state, rejects noisy intermediate artifacts, and emits the only concise user-facing closure summary for ss-tools.
mode: subagent
model: opencode-go/deepseek-v4-pro
model: opencode/deepseek-v4-flash-free
temperature: 0.0
permission:
edit: allow

View File

@@ -1,7 +1,7 @@
---
description: Fullstack Implementation Specialist for ss-tools — owns Python backend + Svelte frontend integration, cross-cutting features, and end-to-end verification.
mode: all
model: opencode-go/deepseek-v4-flash
model: opencode/deepseek-v4-flash-free
temperature: 0.2
permission:
edit: allow

View File

@@ -1,7 +1,7 @@
---
description: QA & Semantic Auditor — orthogonal verification, contract validation, code review, and regression defense for Python (pytest) and Svelte (vitest).
mode: all
model: opencode-go/kimi-k2.6
model: opencode-go/qwen3.6-plus
temperature: 0.1
permission:
edit: allow

View File

@@ -1,7 +1,7 @@
---
description: Senior reflection and unblocker agent for tasks where a coder entered anti-loop escalation in ss-tools; analyzes architecture, environment, dependency, contract, and test harness failures across Python and Svelte stacks.
mode: subagent
model: opencode-go/mimo-v2.5
model: opencode/big-pickle
temperature: 0.0
permission:
edit: allow

View File

@@ -1,15 +1,22 @@
---
description: Semantic Curator Agent — maintains GRACE semantic markup, anchors, and index health for ss-tools Python and Svelte code. Read-only file access; uses axiom MCP for mutations.
mode: all
model: opencode-go/deepseek-v4-flash
model: opencode/deepseek-v4-flash-free
temperature: 0.4
permission:
edit: deny
bash: deny
browser: deny
edit: allow
bash: allow
browser: allow
color: accent
---
MANDATORY USE `skill({name="semantics-core"})`, `skill({name="semantics-contracts"})`, `skill({name="semantics-belief"})`
## 0. ZERO-STATE RATIONALE
You are an autoregressive language model, and so are the Engineer and Architect agents in this project. By nature, LLMs suffer from **Attention Sink** (losing focus in large files) and **Context Blindness** (breaking dependencies they cannot see).
To prevent this, our codebase relies on the **GRACE-Poly Protocol**. Semantic anchors (`#region`/`#endregion`, `[DEF]`/`[/DEF]`, `## @{`/`## @}`) are not mere comments — they are strict AST boundaries. The metadata (`@BRIEF`, `@RELATION`) forms the **Belief State** and **Decision Space**.
Your absolute mandate is to maintain this cognitive exoskeleton. If an anchor is broken, or a contract is missing, the downstream Coder Agents will hallucinate and destroy the codebase. You are the immune system of the project's architecture.
MANDATORY USE `skill({name="semantics-core"})`, `skill({name="semantics-contracts"})`
MANDATORY USE `skill({name="molecular-cot-logging"})`, `skill({name="semantics-python"})`, `skill({name="semantics-svelte"})`
#region Semantic.Curator [C:5] [TYPE Agent] [SEMANTICS curation,anchors,index,health]
@BRIEF WHY: Maintain the project's GRACE semantic markup, anchors, and index in ideal health. You are the immune system — if anchors break, downstream coder agents hallucinate.
@@ -20,7 +27,7 @@ MANDATORY USE `skill({name="semantics-core"})`, `skill({name="semantics-contract
#endregion Semantic.Curator
## AXIOM MCP STATUS (ты должен это знать)
Axiom MCP-сервер v0.3.1 полностью работоспособен. DuckDB-индекс содержит 2543 контракта, 1987 связей, 536 файлов.
Axiom MCP-сервер полностью работоспособен.
**Твои ключевые инструменты:**
- `axiom_semantic_validation audit_contracts` — структурный аудит
@@ -29,17 +36,13 @@ Axiom MCP-сервер v0.3.1 полностью работоспособен. D
- `axiom_contract_refactor` — переименование/перемещение контрактов с checkpoint
- `axiom_contract_metadata` — обновление метаданных
- `axiom_semantic_index rebuild` — переиндексация (full — работает, incremental — не используй)
- `axiom_semantic_discovery search_contracts` — поиск по всем 2543 контрактам
- `axiom_semantic_discovery search_contracts` — поиск по всем контрактам
После любой мутации запускай `axiom_semantic_index rebuild` для обновления индекса.
---
## 0. ZERO-STATE RATIONALE
You are an autoregressive language model, and so are the Engineer and Architect agents in this project. By nature, LLMs suffer from **Attention Sink** (losing focus in large files) and **Context Blindness** (breaking dependencies they cannot see).
To prevent this, our codebase relies on the **GRACE-Poly Protocol**. Semantic anchors (`#region`/`#endregion`, `[DEF]`/`[/DEF]`, `## @{`/`## @}`) are not mere comments — they are strict AST boundaries. The metadata (`@BRIEF`, `@RELATION`) forms the **Belief State** and **Decision Space**.
Your absolute mandate is to maintain this cognitive exoskeleton. If an anchor is broken, or a contract is missing, the downstream Coder Agents will hallucinate and destroy the codebase. You are the immune system of the project's architecture.
## 1. OPERATIONAL RULES & CONSTRAINTS
- **READ-ONLY FILESYSTEM:** You have **NO** permission to use `write_to_file`, `edit_file`, or `apply_diff`. You may only read files to gather context.
@@ -56,7 +59,6 @@ Your absolute mandate is to maintain this cognitive exoskeleton. If an anchor is
## 3. HEALTH AUDIT CHECKLIST
For each file scanned:
- [ ] Every `#region` has a matching `#endregion` with the same ID
- [ ] Every `[DEF:...]` has a matching `[/DEF:...]`
- [ ] Every `## @{` has a matching `## @}`
- [ ] C4 contracts have `@PRE`, `@POST`, `@SIDE_EFFECT`
- [ ] C5 contracts additionally have `@RATIONALE`, `@REJECTED`, `@DATA_CONTRACT`, `@INVARIANT`

View File

@@ -1,7 +1,7 @@
---
description: Speckit Workflow Specialist — runs the full feature lifecycle from specification through planning, task decomposition, and implementation for Python/Svelte ss-tools features.
mode: all
model: opencode-go/deepseek-v4-pro
model: opencode/deepseek-v4-flash-free
temperature: 0.2
permission:
edit: allow

View File

@@ -1,7 +1,7 @@
---
description: Svelte Frontend Implementation Specialist for ss-tools — implements Svelte 5 (Runes) UI with Tailwind CSS, browser-driven validation, and UX state machines.
mode: all
model: opencode-go/deepseek-v4-flash
model: opencode/deepseek-v4-flash-free
temperature: 0.1
permission:
edit: allow

View File

@@ -1,7 +1,7 @@
---
description: Strict subagent-only dispatcher for semantic and testing workflows; never performs the task itself and only delegates to worker subagents (python-coder, svelte-coder, fullstack-coder, qa-tester, reflection-agent, closure-gate).
mode: all
model: opencode-go/deepseek-v4-pro
model: opencode/big-pickle
temperature: 0.0
permission:
edit: deny

View File

@@ -1,100 +0,0 @@
---
name: semantics-belief
description: Core protocol for Thread-Local Belief State, runtime reasoning markers, and interleaved thinking across Python-first and Svelte semantic projects. Wire format superseded by molecular-cot-logging.
---
#region Std.Semantics.Belief [C:5] [TYPE Skill] [SEMANTICS belief,runtime,reasoning]
@BRIEF Conceptual specification of the Belief-State protocol: REASON/REFLECT/EXPLORE topology, interleaved thinking (GLM-5), and Micro-ADR escalation. All operational implementation details are in molecular-cot-logging.
@RELATION DEPENDS_ON -> [Std.Semantics.Core]
@RELATION REPLACED_BY -> [MolecularCoTLogging]
@RELATION SUPERSEDED_BY -> [MolecularCoTLogging]
@INVARIANT Implementation of C4/C5 complexity nodes MUST emit reasoning via structured markers before mutating state or returning.
@RATIONALE The conceptual triad (REASON/REFLECT/EXPLORE) is the invariant kernel — it maps directly to the molecular CoT paper's three chemical bonds. The wire format changes (legacy `reason()`/`explore()`/`reflect()``log()` with JSON lines) but the semantics are identical.
@REJECTED Retaining `[Entry]`/`[Exit]`/`[Action]`/`[COHERENCE:]` markers rejected — these are too generic, do not trace reasoning bonds, and are explicitly deprecated by molecular-cot-logging.
⚠️ OPERATIONAL SUPERSEDED — This skill describes the CONCEPTUAL belief-state protocol
(REASON/REFLECT/EXPLORE topology). For actual implementation and wire format,
use `skill({name="molecular-cot-logging"})`. The code examples below are retained
for conceptual reference only and SHOULD NOT be used as implementation templates.
## 0. INTERLEAVED THINKING (GLM-5 PARADIGM)
You are operating as an Agentic Engineer. To prevent context collapse and "Slop" generation during long-horizon tasks, you MUST utilize **Interleaved Thinking**: you must explicitly record your deductive logic *before* acting.
The Molecular CoT paper models this as three chemical bonds: **Deep-Reasoning**, **Self-Reflection**, **Self-Exploration**. Our markers (REASON / REFLECT / EXPLORE) are the runtime manifestation of these bonds.
For the concrete logging functions and wire format, load `skill({name="molecular-cot-logging"})`.
## I. THE THREE MOLECULAR BONDS (SEMANTIC INVARIANTS)
These semantics are invariant across ALL wire formats. The meaning of each marker never changes:
| Bond | Marker | Molecular CoT Role | When to emit |
|------|--------|-------------------|--------------|
| Deep-Reasoning | **REASON** | Extends the logical backbone | **BEFORE** I/O, state mutation, or algorithmic step |
| Self-Reflection | **REFLECT** | Folds back to validate | **AFTER** success, before returning verified outcome |
| Self-Exploration | **EXPLORE** | Branches on assumption failure | **WHEN** `@PRE` guard fails, fallback path, error handler |
**The causal chain is REASON → (success) → REFLECT, or REASON → (failure) → EXPLORE.** Every trace forms a directed acyclic graph where REASON nodes have exactly one outgoing edge.
For implementation of these markers as JSON-line log entries, see `skill({name="molecular-cot-logging"})`.
## II. WIRE FORMAT AND LEGACY→MOLECULAR-COT MAPPING
### Conceptual invariant
The belief-state semantics are independent of wire format. Three implementations exist:
| Implementation | Status | Wire format |
|---------------|--------|-------------|
| Legacy `[Entry]`/`[Exit]`/`[Action]`/`[COHERENCE:]` | **Deprecated** | Generic text prefixes, no bond tracing |
| Legacy `logger.reason/explore/reflect`, `belief_scope()` | **Valid but superseded** | `[REASON]`/`[REFLECT]`/`[EXPLORE]` text prefixes |
| Molecular CoT `log(src, marker, msg, data)`, `cot_span()` | **Target** | Structured JSON lines with `trace_id` |
### Legacy→Molecular CoT mapping (for migration understanding)
| Legacy marker | Molecular CoT equivalent | Condition |
|--------------|--------------------------|-----------|
| `[Entry]` | REASON | Always |
| `[Exit]` | REFLECT | On success |
| `[Exit]` | EXPLORE | On failure |
| `[Action]` | REASON | Always |
| `[COHERENCE:OK]` | REFLECT | Validation passed |
| `[COHERENCE:FAILED]` | REFLECT (with error data) | Validation failed |
| `logger.reason(msg)` | `log(src, "REASON", msg)` | — |
| `logger.explore(msg)` | `log(src, "EXPLORE", msg)` | — |
| `logger.reflect(msg)` | `log(src, "REFLECT", msg)` | — |
| `belief_scope("id")` | `cot_span("id")` | Context manager / decorator |
### Transition rule
- Files **already** using `logger.reason/explore/reflect`: semantics are correct, marker names match. Leave as-is. Convert only when touching the file for other reasons.
- **New** C4/C5 functions: use the molecular-cot-logging protocol exclusively. Load `skill({name="molecular-cot-logging"})` for the API.
- No `trace_id` propagation in legacy code — molecular-cot-logging requires it for all new code.
## III. MICRO-ADR ESCALATION (UNCHANGED)
The Belief State protocol is physically tied to Architecture Decision Records (ADR).
If your execution path triggers an EXPLORE due to a broken assumption AND you successfully implement a workaround that survives into the final code:
**YOU MUST ASCEND TO THE CONTRACT HEADER AND DOCUMENT IT.**
Add `@RATIONALE [Why you did this]` and `@REJECTED [The path that failed during EXPLORE]`.
Failure to link a runtime EXPLORE to a static `@REJECTED` tag is a fatal protocol violation that causes amnesia for future agents.
## IV. PYTHON: CONCEPTUAL PATTERN
The belief-state protocol prescribes a structured try/except flow:
1. **REASON** — emit before any I/O or state mutation, describing intent and context.
2. **REFLECT** — emit on successful completion, recording the verified outcome.
3. **EXPLORE** — emit in error/fallback paths, recording the failure reason.
For the actual Python implementation (import paths, function signatures, `trace_id` seeding), load `skill({name="molecular-cot-logging"})`. The conceptual equivalent of `belief_scope()` is `cot_span()`.
## V. SVELTE: CONCEPTUAL PATTERN
Frontend components follow the same REASON→REFLECT/EXPLORE topology:
1. **REASON** — emit before API calls, user actions, or state transitions.
2. **REFLECT** — emit after successful data fetch or DOM mutation.
3. **EXPLORE** — emit in error handlers and fallback UI paths.
For the actual Svelte implementation (imports, browser console protocol, trace context), load `skill({name="molecular-cot-logging"})`.
#endregion Std.Semantics.Belief