|
1 | 1 | # PROSE Platform Overview |
2 | 2 |
|
3 | 3 | > PROSE = **P**urpose, **R**ules & Constraints, **O**bservables, **S**cenarios, **E**xpectations |
| 4 | +> |
| 5 | +> Expectations are grounded in **SOPs** — Standard Operating Procedures that define repeatable business outcomes and standardized outputs. |
4 | 6 |
|
5 | 7 | This document describes StackMemory's platform behavior in plain English. Each section is intentionally testable and maps directly to integration tests in `src/__tests__/integration/platform-overview.test.ts`. |
6 | 8 |
|
| 9 | +The contract layer of PROSE is derived from SOPs: every Expectation below corresponds to a procedural guarantee that QA can validate and that can be turned into executable scripts. |
| 10 | + |
7 | 11 | --- |
8 | 12 |
|
9 | 13 | ## P — Purpose |
@@ -71,44 +75,73 @@ Capturing a snapshot persists the current context state for later handoff. |
71 | 75 |
|
72 | 76 | ## E — Expectations |
73 | 77 |
|
74 | | -Properties that must always hold true and guarantees the platform makes to users and integrations. |
| 78 | +Properties that must always hold true and guarantees the platform makes to users and integrations. Each Expectation is backed by one or more SOPs so that business outcomes can be standardized, QA'd, and automated. |
75 | 79 |
|
76 | 80 | ### E.1 Frame stack integrity |
77 | 81 | At any time, there is at most one active frame, and the frame stack is non-circular. |
78 | 82 |
|
| 83 | +**SOP basis:** `SOP-101 Frame Lifecycle` — frames must be pushed and popped in a deterministic order; no orphaned active frames are allowed. |
| 84 | + |
79 | 85 | ### E.2 Decision immutability |
80 | 86 | Once recorded, a decision's identifier, title, and rationale must not change. |
81 | 87 |
|
| 88 | +**SOP basis:** `SOP-102 Decision Record Keeping` — decisions are audit records and must remain tamper-evident. |
| 89 | + |
82 | 90 | ### E.3 Project isolation |
83 | 91 | Two projects initialized in different directories must not share context unless explicitly synced. |
84 | 92 |
|
| 93 | +**SOP basis:** `SOP-103 Project Boundary Enforcement` — each project directory owns its SQLite database and must not leak state into neighboring projects. |
| 94 | + |
85 | 95 | ### E.4 CLI contract |
86 | 96 | All CLI commands return a zero exit code on success and a non-zero exit code on failure, with human-readable output. |
87 | 97 |
|
| 98 | +**SOP basis:** `SOP-201 CLI Exit-Code Compliance` — scripts and CI pipelines depend on reliable exit codes. |
| 99 | + |
88 | 100 | ### E.5 SQLite contract |
89 | 101 | The local SQLite database is self-contained within `.stackmemory/` and portable across machines with the same CLI version. |
90 | 102 |
|
| 103 | +**SOP basis:** `SOP-202 Data Portability` — the database must be relocatable and restorable without external services. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## SOP → PROSE → Tests workflow |
| 108 | + |
| 109 | +``` |
| 110 | +SOP (business outcome) |
| 111 | + │ |
| 112 | + ▼ |
| 113 | +PROSE Expectation (plain-English contract) |
| 114 | + │ |
| 115 | + ▼ |
| 116 | +Integration test (executable validation) |
| 117 | + │ |
| 118 | + ▼ |
| 119 | +Feature-script parity (automation) |
| 120 | +``` |
| 121 | + |
| 122 | +For example, `SOP-101 Frame Lifecycle` becomes PROSE `E.1`, which becomes the test `active frame stack remains consistent`. QA can run the same test suite to verify SOP compliance, and the test can be used to generate or validate automation scripts. |
| 123 | + |
91 | 124 | --- |
92 | 125 |
|
93 | 126 | ## Test mapping |
94 | 127 |
|
95 | | -| PROSE ID | Test case | |
96 | | -|----------|-----------| |
97 | | -| P.1 | `initializes a project with stackmemory init` | |
98 | | -| P.2 | `retrieves decisions across sessions` | |
99 | | -| R.1 | `fails gracefully outside an initialized project` | |
100 | | -| R.2 | `returns empty results for non-matching search` | |
101 | | -| R.3 | `init is idempotent` | |
102 | | -| O.1 | `reports status for initialized and uninitialized projects` | |
103 | | -| O.2 | `lists pushed frames` | |
104 | | -| O.3 | `lists recorded decisions` | |
105 | | -| O.4 | `searches stored context` | |
106 | | -| S.1 | `pushing a frame creates a scoped entry` | |
107 | | -| S.2 | `popping a frame restores the previous frame` | |
108 | | -| S.3 | `recording a decision persists rationale` | |
109 | | -| S.4 | `capturing a snapshot persists handoff state` | |
110 | | -| E.1 | `active frame stack remains consistent` | |
111 | | -| E.2 | `recorded decisions are immutable` | |
112 | | -| E.3 | `projects in different directories are isolated` | |
113 | | -| E.4 | `CLI commands return correct exit codes` | |
114 | | -| E.5 | `SQLite database is self-contained in .stackmemory` | |
| 128 | +| PROSE ID | SOP basis | Test case | |
| 129 | +|----------|-----------|-----------| |
| 130 | +| P.1 | — | `initializes a project with stackmemory init` | |
| 131 | +| P.2 | — | `retrieves decisions across sessions` | |
| 132 | +| R.1 | — | `fails gracefully outside an initialized project` | |
| 133 | +| R.2 | — | `returns empty results for non-matching search` | |
| 134 | +| R.3 | — | `init is idempotent` | |
| 135 | +| O.1 | — | `reports status for initialized and uninitialized projects` | |
| 136 | +| O.2 | — | `lists pushed frames` | |
| 137 | +| O.3 | — | `lists recorded decisions` | |
| 138 | +| O.4 | — | `searches stored context` | |
| 139 | +| S.1 | — | `pushing a frame creates a scoped entry` | |
| 140 | +| S.2 | — | `popping a frame restores the previous frame` | |
| 141 | +| S.3 | — | `recording a decision persists rationale` | |
| 142 | +| S.4 | — | `capturing a snapshot persists handoff state` | |
| 143 | +| E.1 | `SOP-101 Frame Lifecycle` | `active frame stack remains consistent` | |
| 144 | +| E.2 | `SOP-102 Decision Record Keeping` | `recorded decisions are immutable` | |
| 145 | +| E.3 | `SOP-103 Project Boundary Enforcement` | `projects in different directories are isolated` | |
| 146 | +| E.4 | `SOP-201 CLI Exit-Code Compliance` | `CLI commands return correct exit codes` | |
| 147 | +| E.5 | `SOP-202 Data Portability` | `SQLite database is self-contained in .stackmemory` | |
0 commit comments