mirror of
https://github.com/LerianStudio/ring
synced 2026-04-21 13:37:27 +00:00
Reclassify gates 1,2,4,5,6w,7w,8 (backend) and 1,2,4,5,6,7 (frontend) from subtask to task cadence. Gates 0, 3, 9 remain subtask-level. All 8 reviewers still run, all quality thresholds preserved. Additional changes: standards pre-cache at Step 1.5 (cached_standards in state); Gate 0.5 merged into Gate 0 exit criteria via ring:dev-implementation Step 7; dev-report aggregates cycle-wide via accumulated_metrics (single cycle-end dispatch); dev-refactor clusters findings by (file, pattern_category) with findings:[] traceability array; read-after-write state verification removed; per-subtask visual reports opt-in only. State schema v1.1.0 (additive - backward compatible). New shared patterns: standards-cache-protocol.md, gate-cadence-classification.md. X-Lerian-Ref: 0x1
1.7 KiB
1.7 KiB
| name | description |
|---|---|
| shared-pattern:standards-cache-protocol | Protocol for reading cached standards from cycle state instead of WebFetching directly. |
Standards Cache Protocol
Purpose
Eliminate redundant WebFetch calls during a dev-cycle by pre-caching all required standards at cycle start (dev-cycle Step 1.5) and having sub-skills read from state.
Protocol
For Sub-Skills
When a sub-skill needs a standards document:
STEP 1: Check state cache
IF state.cached_standards[URL] exists:
content = state.cached_standards[URL].content
log: "Using cached standard: {URL} (fetched {fetched_at})"
proceed with content
ELSE:
goto STEP 2
STEP 2: Fallback WebFetch (only if cache miss)
log WARNING: "Standard {URL} not in cache; fetching inline"
content = WebFetch(URL)
proceed with content
For Orchestrators (dev-cycle, dev-cycle-frontend)
At Step 1.5 of the cycle:
- Detect project stack (Go / TypeScript / Frontend)
- Build URL list (see dev-cycle Step 1.5 for current list)
- WebFetch each URL once
- Write to
state.cached_standards[URL] = {fetched_at, content} - MANDATORY: Save state to file
- Blocker if ANY URL fails to fetch
Why
Before: ~15–25 WebFetch calls per cycle (one per sub-skill dispatch). Prompt cache TTL of 5 min is regularly exceeded, causing repeated network fetches of identical content.
After: Exactly ONE WebFetch per unique URL per cycle. Same content, ~5x fewer network operations.
Safety
If the cache mechanism fails or is bypassed:
- Sub-skills fall back to direct WebFetch (with warning log).
- No correctness regression; only performance regression.
- Operators can monitor "Standard {URL} not in cache" warnings to detect misconfigurations.