You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(docs,tests): rename POETIC spec format to PROSE
Replace the POETIC acronym (Purpose, Observables, Edges, Triggers,
Invariants, Contracts) with PROSE:
- P — Purpose
- R — Rules & Constraints
- O — Observables
- S — Scenarios
- E — Expectations
Rename the spec file and update all test comments, section headers,
and IDs to match. No behavioral changes to the tests themselves.
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
6
@@ -18,6 +18,21 @@ Decisions, frames, and anchors written in one session must be retrievable in a s
18
18
19
19
---
20
20
21
+
## R — Rules & Constraints
22
+
23
+
Boundaries the platform must respect.
24
+
25
+
### R.1 Uninitialized projects
26
+
Commands that require an initialized project must fail gracefully with a clear message when run outside a `.stackmemory` project.
27
+
28
+
### R.2 Empty result sets
29
+
Search queries that match nothing must return an empty result set, not an error.
30
+
31
+
### R.3 Idempotent initialization
32
+
Running `stackmemory init` in an already-initialized project must not corrupt existing data.
33
+
34
+
---
35
+
21
36
## O — Observables
22
37
23
38
These are the externally visible states and queries the platform must support.
@@ -36,89 +51,64 @@ After recording a decision, `stackmemory decision list` must include the decisio
36
51
37
52
---
38
53
39
-
## E — Edges & Constraints
54
+
## S — Scenarios
40
55
41
-
Boundaries the platform must respect.
42
-
43
-
### E.1 Uninitialized projects
44
-
Commands that require an initialized project must fail gracefully with a clear message when run outside a `.stackmemory` project.
56
+
Events and actions that change platform state.
45
57
46
-
### E.2 Empty result sets
47
-
Search queries that match nothing must return an empty result set, not an error.
48
-
49
-
### E.3 Idempotent initialization
50
-
Running `stackmemory init` in an already-initialized project must not corrupt existing data.
51
-
52
-
---
53
-
54
-
## T — Triggers
55
-
56
-
Events that change platform state.
57
-
58
-
### T.1 Frame push
58
+
### S.1 Frame push
59
59
Pushing a frame creates a new scoped context entry and updates the active frame stack.
60
60
61
-
### T.2 Frame pop
61
+
### S.2 Frame pop
62
62
Popping a frame removes the active frame and restores the previous frame as active.
63
63
64
-
### T.3 Decision record
64
+
### S.3 Decision record
65
65
Recording a decision persists it with a timestamp and rationale.
66
66
67
-
### T.4 Snapshot capture
67
+
### S.4 Snapshot capture
68
68
Capturing a snapshot persists the current context state for later handoff.
69
69
70
70
---
71
71
72
-
## I — Invariants
72
+
## E — Expectations
73
73
74
-
Properties that must always hold true.
74
+
Properties that must always hold true and guarantees the platform makes to users and integrations.
75
75
76
-
### I.1 Frame stack integrity
76
+
### E.1 Frame stack integrity
77
77
At any time, there is at most one active frame, and the frame stack is non-circular.
78
78
79
-
### I.2 Decision immutability
79
+
### E.2 Decision immutability
80
80
Once recorded, a decision's identifier, title, and rationale must not change.
81
81
82
-
### I.3 Project isolation
82
+
### E.3 Project isolation
83
83
Two projects initialized in different directories must not share context unless explicitly synced.
84
84
85
-
---
86
-
87
-
## C — Contracts
88
-
89
-
Guarantees the platform makes to users and integrations.
90
-
91
-
### C.1 CLI contract
85
+
### E.4 CLI contract
92
86
All CLI commands return a zero exit code on success and a non-zero exit code on failure, with human-readable output.
93
87
94
-
### C.2 SQLite contract
88
+
### E.5 SQLite contract
95
89
The local SQLite database is self-contained within `.stackmemory/` and portable across machines with the same CLI version.
96
90
97
-
### C.3 MCP contract
98
-
When exposed via MCP, tools advertise stable names and JSON schemas that do not change without a version bump.
99
-
100
91
---
101
92
102
93
## Test mapping
103
94
104
-
|POETIC ID | Test case |
105
-
|-----------|-----------|
95
+
|PROSE ID | Test case |
96
+
|----------|-----------|
106
97
| P.1 |`initializes a project with stackmemory init`|
107
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`|
108
102
| O.1 |`reports status for initialized and uninitialized projects`|
109
103
| O.2 |`lists pushed frames`|
110
104
| O.3 |`lists recorded decisions`|
111
105
| O.4 |`searches stored context`|
112
-
| E.1 |`fails gracefully outside an initialized project`|
113
-
| E.2 |`returns empty results for non-matching search`|
114
-
| E.3 |`init is idempotent`|
115
-
| T.1 |`pushing a frame creates a scoped entry`|
116
-
| T.2 |`popping a frame restores the previous frame`|
117
-
| T.3 |`recording a decision persists rationale`|
118
-
| T.4 |`capturing a snapshot persists handoff state`|
119
-
| I.1 |`active frame stack remains consistent`|
120
-
| I.2 |`recorded decisions are immutable`|
121
-
| I.3 |`projects in different directories are isolated`|
122
-
| C.1 |`CLI commands return correct exit codes`|
123
-
| C.2 |`SQLite database is self-contained in .stackmemory`|
124
-
| C.3 |`MCP tools expose stable schemas`|
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`|
0 commit comments