Skip to main content
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

RStack SDLC Full Ecosystem Architecture — 9 layers: Developer, CLI Interface, Pi Extension (13 tools), Harness Core (7 modules), 15-Stage Pipeline, Governance + Security + Episodic Memory, Observability, Notifications and Handoff, Asset Registry and Run State

Interactive Flow (Mermaid)


Layer 1 — Intake & Alignment (Runtime Adapter)

File: extensions/rstack-sdlc.ts
Layer 1 Runtime Adapter and Goal Intake Flow Details
The Pi extension is the entry point. It runs as a TypeScript module inside Pi and wires RStack to the Pi lifecycle via six hooks.

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.
RStack SDLC Execution Sandbox Flow Details

contracts.js — Builder & Validator contract schemas

Builder contract required fields:
Builder status values: PASS | FAIL | BLOCKED | DONE_WITH_CONCERNS Validator contract required fields:
Validator status values: 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:
Stage artifacts live at: .rstack/runs/<run_id>/artifacts/stages/<stage-id>/<artifact>

guardrails.js — Task execution limits

These are enforced by the harness — not by prompting. An agent that exceeds maxToolCallsPerTask is stopped regardless of its prose.
RStack SDLC Harness Core Guardrail Policies Details

evidence.js — Evidence ledger

Every validator-grounded task result is appended as a structured entry to evidence.jsonl:
Required fields: 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:
RStack SDLC Threats and Compliance Safeguards Details

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:
Prompt injection detection:
Any episode containing these patterns is rejected at write time — it never reaches the memory store.

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.
RStack Gated Agentic Execution Detailed Micro-Architecture Flow

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.
RStack SDLC 15-Stage Pipeline Flow and Handoff Gates Diagram

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 of minScore=0.08 to give historical context.
  • Prerequisite Checking: Inspects the approvals.json ledger 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.json contract 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 executes bash strictly 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.json contract 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_modified array actually exists on disk.
  • Test Verification Check: Assumes tests ran successfully and parses the test report evidence files.
  • Double-Sign Matching: Ensures both builder.json and validation.json structures 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=2 to 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.jsonl linking 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)

Layer 4 Dual Human-in-the-Loop Sign-off Gates Details

Approval gates

The sdlc_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
Layer 5 Continuous Episodic Memory & Deployment Delivery Details

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 prompts

Agent 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):
The dashboard auto-refreshes every 2 seconds and shows:
  • 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.json for 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:
Output includes tool calls, guardrail hits, memory recalls, validation checks, and stage transitions — formatted as a human-readable trace stream.

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:
The same variable accepts Discord and Microsoft Teams URLs — RStack auto-converts the Slack Block Kit payload to the native format:

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:
To restore a stage to its last checkpoint:
Rollback copies the checkpoint back over the live stage directory and appends a 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.
This prevents a compromised or externally modified episode store from injecting false context into future runs.

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:
When sdlc_build_next detects attempt >= 2, it appends a model_escalated event to events.jsonl:
The orchestrator then uses the escalated model for the retry delegate call. If RSTACK_ESCALATED_MODEL is unset, no escalation occurs and the same model is reused.

Operating standard

Every agent in the system follows agents/OPERATING-STANDARD.md, which enforces:
  1. Evidence before action — No guessing. Every decision is grounded in files, commands, contracts, or explicit user answers.
  2. Context hygiene — Scout before read. No large file dumps. Select only the specialist needed.
  3. User-friendly orchestration — Ask before deleting, deploying, or choosing between materially different behaviors. Give a recommendation and 2–3 options.
  4. Production quality bar — Testable requirements · explicit trade-offs · no TODO stubs · error handling · security review · tests run · documentation exists.

CI / release pipeline

GitHub Actions workflows:
  • ci.yml — test + validate + audit on every push
  • publish.yml — gated npm publish on release tag
  • validate-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.