This document is written for engineering leaders and technical stakeholders. It covers the complete RStack ecosystem as built across the
feat/harness-foundation and feat/episodic-memory-layer branches, now merged to main.Back to Overview
Return to the main RStack SDLC introduction and product features.
Quickstart Guide
Get RStack running in under 5 minutes.
Executive summary
RStack SDLC is a governed AI software-delivery harness. It wraps AI coding agents in a deterministic reliability layer — enforcing lifecycle contracts, approval gates, evidence requirements, guardrails, and episodic memory — so that software is built the way a productive engineering team would build it, not the way a single chatbot would guess at it. The system has nine distinct layers:Full ecosystem diagram
Interactive Flow (Mermaid)
Layer 1 — Intake & Alignment (Runtime Adapter)
File:extensions/rstack-sdlc.ts
Lifecycle hooks
Registered SDLC tools (15 total)
Layer 2 — Deterministic Governance (Harness Core & Guardrails)
Directory:src/harness/
The harness is the deterministic reliability shell. It never trusts agent prose. It requires signed contracts and evidence for every task completion.
contracts.js — Builder & Validator contract schemas
Builder contract required fields:
PASS | FAIL | BLOCKED | DONE_WITH_CONCERNS
Validator contract required fields:
PASS | FAIL
Retry recommendations: none | retry_builder | ask_user | block
The sdlc_validate tool runs these checks plus enhanced evidence checks for passing tasks: meaningful summary, non-empty tests_run, memory_summary.work_done, memory_summary.evidence, and at least one evidence-backed stage_summaries entry per canonical stage listed in the task prompt.
stages.js — Canonical SDLC stages
Fifteen canonical stages are locked in order by the test suite. Any reordering or deletion fails CI:
.rstack/runs/<run_id>/artifacts/stages/<stage-id>/<artifact>
guardrails.js — Task execution limits
maxToolCallsPerTask is stopped regardless of its prose.
evidence.js — Evidence ledger
Every validator-grounded task result is appended as a structured entry to evidence.jsonl:
task_id · kind · status · evidence. Events with missing fields are rejected at write time.
run-state.js — Run directory management
Creates and validates the canonical directory structure for every run:
Security Guardrail Specifications
We enforce deterministic path and command restrictions in real-time. This forms the defensive shield of Layer 2’s Deterministic Governance:Protected shell commands (blocked by tool_call hook)
Protected write paths
Episodic memory security (in memory.js)
Before any episode is written to the memory store, two sanitisation passes run:
Secret pattern scrubbing:
Layer 3 — Gated Agentic Execution (Orchestrator, Builder & Validator Sandboxes)
Below is a detailed, technical and business-focused visual breakdown of the Gated Agentic Execution phase. It maps out how the system prepares a task, delegates it to separate Builder and Validator sandboxes, audits deliverables against signed contracts, and logs results in our secure memory store.The 15-Stage Pipeline Lifecycle & Handoffs
To secure the entire software-delivery lifecycle, the SDLC orchestrator enforces a structured 15-stage pipeline. The diagram below details every phase, their strict output JSON reports, automated audit handoff gates, and the final notification flow.Execution Step-by-Step Breakdown
Step 1: Context Assembly & Dispatch (sdlc_build_next)
The Harness Core initializes the task and compiles its input prompt.md in a deterministic manner to prevent hallucination:
- Prompts Registry: Merges the core operational standards with specialist instructions aligned with the active stage domain (e.g.,
specialists/backend.md). - Episodic Recall: Performs a fast lexical keyword query on the run’s memory directory (
~/.rstack/memory/and.rstack/memory/). It fetches the top 3 matching episodes with a similarity threshold ofminScore=0.08to give historical context. - Prerequisite Checking: Inspects the
approvals.jsonledger to ensure all mandatory gates (e.g., requirements and architecture approvals) are met.
Step 2: Isolated Builder Sandbox (Write-Active sdlc_delegate)
To build the solution, the orchestrator spawns a Builder Worker Subprocess inside an isolated Pi workspace:
- Tool Constraints: Equipped with write-enabled commands (
read, edit, write, bash, grep, find, ls). - Deliverable Action: Implements code logic, creates corresponding automated test files, and ensures execution safety standards are followed.
- Contract Output: Upon completion, writes a strictly structured
builder.jsoncontract recording the task ID, final PASS/FAIL status, summary of work done, files modified, test suites run, next-step handoffs, and reusable episodic memory keys.
Step 3: Isolated Validator Sandbox (Read-Only sdlc_delegate)
To eliminate confirmation bias, a Validator Worker Subprocess is spawned independently:
- Strict Sandbox Isolation: Confined to read-only tools (
read, grep, find, ls, bash). It has read access to the workspace and executesbashstrictly to run test suites—it cannot write or edit files. - Deliverable Action: Audits the code changes, traces design features against business specs, and runs the automated test runner to verify test metrics pass.
- Contract Output: Signs and saves a
validation.jsoncontract declaring the pass status and any detected issues.
Step 4: Quality Contract Gating & Audit (sdlc_validate)
The Harness Core intercepts validation contracts and conducts an on-disk physical audit:
- Physical Integrity Audit: Verifies every file declared in the Builder’s
files_modifiedarray actually exists on disk. - Test Verification Check: Assumes tests ran successfully and parses the test report evidence files.
- Double-Sign Matching: Ensures both
builder.jsonandvalidation.jsonstructures match, are signed, and pass all verification rules. - Routing Logic:
- PASS: Commits the deliverables, advances the run to the next canonical stage, and logs success.
- FAIL / BLOCKED: Instantly registers a failure and re-routes the task back to the Builder Sandbox for fixes (capped at
maxTaskAttempts=2to prevent infinite loops).
Step 5: Evidence Ledgering & Memory Absorption
Once validation succeeds, two immutable storage events trigger:- Evidence Ledgering: Appends a verified entry to
evidence.jsonllinking the task and validator contract path for compliance auditing. - Episodic Learning Absorption: Translates the task outcomes into a reusable episode. Before writing, a Secret Sanitiser & Injection Filter scrubs secret keys, passwords, and prompt injection attempts. The clean, safe episode is written to
.rstack/memory/and the global database to benefit future SDLC runs.
Layer 4 — Dual Human Sign-off (HITL Gates)
Approval gates
Thesdlc_approve tool records human decisions as typed approval records:
sdlc_build_next checks approvals.json before assembling each task packet. If required approvals are missing, the build is blocked with an actionable message.
Two run modes
Lifecycle stage gates
Layer 5 — Delivery & Memory (Episodic Memory)
File:src/harness/memory.js
Architecture
Episode schema (required fields)
Configuration (.rstack/memory-config.json or env)
Memory locations
Layer 6 — Asset registry
Counts: 196 agents · 68 skills · 72 plugins · 36 promptsAgent hierarchy
Plugin domain packs
Each plugin bundles domain-specific agents, skills, and commands:Registry files (auto-generated)
Layer 7 — Run state layout
Observability Hub
Files:src/harness/reporter.js · src/harness/dashboard.js · extensions/rstack-sdlc.ts
RStack ships a built-in enterprise observability stack. Three components work together: a live HTML dashboard, a CLI event tracer, and a metrics.json ledger updated after every task.
sdlc_dashboard — Live HTML dashboard
Generates dashboard.html under the run directory and starts a local HTTP server (default port 3008):
- Stage Execution Timeline — all 15 canonical stages with PASS / FAIL / PENDING status pills
- Cumulative Metrics — total duration, API cost cap, tool-call buffer (current / max 40)
- Traceability Explorer — link to
traceability.jsonfor full req → task → file → test mapping - Harness Guardrail Limits — live view of enforced policy values
sdlc_trace — CLI event trace
Prints a chronological log of all events for a task:
metrics.json — Run metrics ledger
updateRunMetrics() appends to .rstack/runs/<run_id>/metrics.json after each task:
reporter.js — RunReport builder
buildRunReport(runDir) compiles a typed RunReport from events.jsonl, evidence.jsonl, tasks.json, and manifest.json. Reports surface task counts, failure summaries, memory event counts, and guardrail hit totals — used by sdlc_trace and sdlc_dashboard.
Webhook Notifications
File:src/harness/notifications.js
RStack fires structured webhook payloads at every stage gate and task completion. Set one environment variable to activate:
Notification events
The task execution report includes tool call count, guardrail hits, memory recall/write counts, and individual validation check results (PASS/FAIL per check name).
Stage Checkpoints & Rollback
File:src/harness/run-state.js · Tool: sdlc_rollback
After each successful sdlc_validate, RStack snapshots the stage artifact directory to a checkpoints/ folder inside the run:
stage_checkpoint_reverted event to events.jsonl. If no checkpoint exists for the stage, the tool returns a clear NO_CHECKPOINT status without modifying anything.
BFT Cryptographic Memory Signatures
File:src/harness/memory.js
Every episode written to the memory store is cryptographically signed before persistence. calculateEpisodeSignature(episode) produces a deterministic hash from the episode’s canonical fields. On recall, verifyEpisodeSignature(episode) recomputes and compares — episodes with tampered or missing signatures are filtered out before injection into task prompts.
Model Escalation Routing
File:extensions/rstack-sdlc.ts
When a task exceeds its first attempt, RStack can automatically escalate to a more capable model for the retry. Set the escalation target via environment variable:
sdlc_build_next detects attempt >= 2, it appends a model_escalated event to events.jsonl:
RSTACK_ESCALATED_MODEL is unset, no escalation occurs and the same model is reused.
Operating standard
Every agent in the system followsagents/OPERATING-STANDARD.md, which enforces:
- Evidence before action — No guessing. Every decision is grounded in files, commands, contracts, or explicit user answers.
- Context hygiene — Scout before read. No large file dumps. Select only the specialist needed.
- User-friendly orchestration — Ask before deleting, deploying, or choosing between materially different behaviors. Give a recommendation and 2–3 options.
- Production quality bar — Testable requirements · explicit trade-offs · no TODO stubs · error handling · security review · tests run · documentation exists.
CI / release pipeline
ci.yml— test + validate + audit on every pushpublish.yml— gated npm publish on release tagvalidate-agents.yml— agent frontmatter and duplicate-name checks
Back to Overview
Return to the main RStack SDLC introduction and overview.
Go to Quickstart
Get RStack running in under 5 minutes.
