@dv.nghiem/flowdeck 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +13 -21
  2. package/dist/agents/code-explorer.d.ts.map +1 -1
  3. package/dist/agents/mapper.d.ts.map +1 -1
  4. package/dist/agents/orchestrator.d.ts.map +1 -1
  5. package/dist/agents/planner.d.ts.map +1 -1
  6. package/dist/agents/specialist.d.ts.map +1 -1
  7. package/dist/dashboard/server.mjs +12 -2
  8. package/dist/hooks/compaction-hook.d.ts +1 -2
  9. package/dist/hooks/compaction-hook.d.ts.map +1 -1
  10. package/dist/hooks/file-tracker.d.ts +6 -0
  11. package/dist/hooks/file-tracker.d.ts.map +1 -1
  12. package/dist/hooks/notifications.d.ts.map +1 -1
  13. package/dist/hooks/session-start.d.ts.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +742 -794
  16. package/dist/lib/completion-validator.d.ts +51 -0
  17. package/dist/lib/completion-validator.d.ts.map +1 -0
  18. package/dist/lib/recommended-question.d.ts +24 -0
  19. package/dist/lib/recommended-question.d.ts.map +1 -0
  20. package/dist/lib/research-gate.d.ts +97 -0
  21. package/dist/lib/research-gate.d.ts.map +1 -0
  22. package/dist/lib/research-gate.test.d.ts +2 -0
  23. package/dist/lib/research-gate.test.d.ts.map +1 -0
  24. package/dist/mcp/index.d.ts +12 -2
  25. package/dist/mcp/index.d.ts.map +1 -1
  26. package/dist/services/codegraph.d.ts +36 -0
  27. package/dist/services/codegraph.d.ts.map +1 -0
  28. package/dist/services/codegraph.test.d.ts +2 -0
  29. package/dist/services/codegraph.test.d.ts.map +1 -0
  30. package/dist/services/question-guard.d.ts +4 -0
  31. package/dist/services/question-guard.d.ts.map +1 -1
  32. package/dist/services/recommended-question.test.d.ts +2 -0
  33. package/dist/services/recommended-question.test.d.ts.map +1 -0
  34. package/dist/services/supervisor-binding.d.ts +3 -1
  35. package/dist/services/supervisor-binding.d.ts.map +1 -1
  36. package/dist/tools/codebase-index.d.ts +30 -0
  37. package/dist/tools/codebase-index.d.ts.map +1 -0
  38. package/dist/tools/codebase-index.test.d.ts +2 -0
  39. package/dist/tools/codebase-index.test.d.ts.map +1 -0
  40. package/dist/tools/codegraph-tool.d.ts +3 -0
  41. package/dist/tools/codegraph-tool.d.ts.map +1 -0
  42. package/dist/tools/planning-state-lib.d.ts +23 -0
  43. package/dist/tools/planning-state-lib.d.ts.map +1 -1
  44. package/docs/agents/index.md +154 -0
  45. package/docs/commands/fd-ask.md +71 -39
  46. package/docs/commands/fd-checkpoint.md +63 -8
  47. package/docs/commands/fd-deploy-check.md +166 -9
  48. package/docs/commands/fd-design.md +101 -0
  49. package/docs/commands/fd-discuss.md +87 -20
  50. package/docs/commands/fd-doctor.md +100 -13
  51. package/docs/commands/fd-done.md +215 -0
  52. package/docs/commands/fd-execute.md +104 -0
  53. package/docs/commands/fd-fix-bug.md +144 -24
  54. package/docs/commands/fd-map-codebase.md +85 -21
  55. package/docs/commands/fd-multi-repo.md +155 -40
  56. package/docs/commands/fd-new-feature.md +63 -19
  57. package/docs/commands/fd-plan.md +80 -27
  58. package/docs/commands/fd-quick.md +143 -29
  59. package/docs/commands/fd-reflect.md +81 -13
  60. package/docs/commands/fd-resume.md +65 -8
  61. package/docs/commands/fd-status.md +80 -12
  62. package/docs/commands/fd-suggest.md +114 -0
  63. package/docs/commands/fd-translate-intent.md +69 -9
  64. package/docs/commands/fd-verify.md +71 -14
  65. package/docs/commands/fd-write-docs.md +121 -8
  66. package/docs/concepts/architecture.md +163 -0
  67. package/docs/concepts/governance.md +242 -0
  68. package/docs/concepts/intelligence.md +145 -0
  69. package/docs/concepts/multi-repo.md +227 -0
  70. package/docs/concepts/workflows.md +205 -0
  71. package/docs/configuration/index.md +208 -0
  72. package/docs/configuration/opencode-settings.md +98 -0
  73. package/docs/getting-started/first-project.md +126 -0
  74. package/docs/getting-started/installation.md +73 -0
  75. package/docs/getting-started/quick-start.md +74 -0
  76. package/docs/index.md +36 -72
  77. package/docs/reference/hooks.md +176 -0
  78. package/docs/reference/rules.md +109 -0
  79. package/docs/skills/code-review.md +47 -0
  80. package/docs/skills/index.md +148 -0
  81. package/docs/skills/planning.md +39 -0
  82. package/package.json +1 -1
  83. package/src/commands/fd-discuss.md +74 -10
  84. package/src/commands/fd-done.md +196 -0
  85. package/src/commands/fd-execute.md +43 -6
  86. package/src/commands/fd-fix-bug.md +43 -6
  87. package/src/commands/fd-map-codebase.md +99 -19
  88. package/src/commands/fd-new-feature.md +14 -5
  89. package/src/commands/fd-plan.md +38 -1
  90. package/src/commands/fd-quick.md +1 -1
  91. package/src/commands/fd-resume.md +1 -1
  92. package/src/commands/fd-status.md +1 -1
  93. package/src/commands/fd-verify.md +16 -2
  94. package/src/commands/fd-write-docs.md +30 -5
  95. package/src/skills/context-load/SKILL.md +1 -1
  96. package/dist/hooks/memory-hook.d.ts +0 -28
  97. package/dist/hooks/memory-hook.d.ts.map +0 -1
  98. package/dist/services/memory-store.d.ts +0 -73
  99. package/dist/services/memory-store.d.ts.map +0 -1
  100. package/dist/services/memory-store.test.d.ts +0 -2
  101. package/dist/services/memory-store.test.d.ts.map +0 -1
  102. package/dist/tools/memory-search.d.ts +0 -3
  103. package/dist/tools/memory-search.d.ts.map +0 -1
  104. package/dist/tools/memory-status.d.ts +0 -3
  105. package/dist/tools/memory-status.d.ts.map +0 -1
  106. package/docs/USER_GUIDE.md +0 -20
  107. package/docs/agents.md +0 -544
  108. package/docs/best-practices.md +0 -47
  109. package/docs/commands/fd-new-project.md +0 -24
  110. package/docs/commands.md +0 -557
  111. package/docs/configuration.md +0 -325
  112. package/docs/design-first-workflow.md +0 -94
  113. package/docs/feature-integration-architecture.md +0 -227
  114. package/docs/installation.md +0 -123
  115. package/docs/intelligence.md +0 -370
  116. package/docs/memory.md +0 -69
  117. package/docs/multi-repo.md +0 -201
  118. package/docs/notifications.md +0 -170
  119. package/docs/optimization-baseline.md +0 -21
  120. package/docs/quick-start.md +0 -197
  121. package/docs/rules.md +0 -432
  122. package/docs/skills.md +0 -417
  123. package/docs/workflows.md +0 -134
  124. package/src/commands/fd-new-project.md +0 -114
@@ -1,123 +0,0 @@
1
- # FlowDeck Installation
2
-
3
- This guide covers all three ways to install FlowDeck, how to verify the installation, how to keep it up to date, and how to remove it cleanly.
4
-
5
- ---
6
-
7
- ## Prerequisites
8
-
9
- Before installing FlowDeck, ensure the following tools are available:
10
-
11
- | Requirement | Minimum version | Check command |
12
- |-------------|----------------|---------------|
13
- | OpenCode | 1.0 | `opencode --version` |
14
- | Node.js | 18 | `node --version` |
15
- | npm | 9 | `npm --version` |
16
-
17
- If OpenCode is not yet installed, follow the [OpenCode installation guide](https://opencode.ai/docs) before continuing.
18
-
19
- ---
20
-
21
- ## Method 1: curl (recommended)
22
-
23
- The install script registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json` and sets `orchestrator` as default agent when missing.
24
-
25
- ```bash
26
- curl -fsSL https://raw.githubusercontent.com/DVNghiem/flowdeck/main/install.sh | bash
27
- ```
28
-
29
- What the script does:
30
-
31
- 1. Detects your config directory (`$OPENCODE_CONFIG_DIR` or `~/.config/opencode`)
32
- 2. Creates the config directory if needed
33
- 3. Registers `@dv.nghiem/flowdeck` as a plugin in `opencode.json` if not present
34
- 4. Sets `orchestrator` as the default agent if not already configured
35
-
36
- ---
37
-
38
- ## Method 2: npx (no git required)
39
-
40
- If you prefer not to clone the repository, run FlowDeck's bundled installer directly through npm:
41
-
42
- ```bash
43
- npx @dv.nghiem/flowdeck install
44
- ```
45
-
46
- This fetches the latest published package from the npm registry and runs the same installation steps as the curl method.
47
-
48
- ---
49
-
50
- Steps explained:
51
-
52
- - `npm install` — fetches Node.js dependencies
53
- - `npm run build` — compiles TypeScript source in `src/` to `dist/`
54
- - `bash install.sh` — copies built assets to `~/.config/opencode/` and updates `opencode.json`
55
-
56
- ---
57
-
58
- ## Verification
59
-
60
- After any install method, run these commands to confirm registration:
61
-
62
- ```bash
63
- # Should print @dv.nghiem/flowdeck
64
- cat ~/.config/opencode/opencode.json | grep flowdeck
65
- ```
66
-
67
- Expected output for the last command:
68
-
69
- ```
70
- "@dv.nghiem/flowdeck"
71
- ```
72
-
73
- If the `opencode.json` line is missing, the plugin will not load — add it manually (see [Configuration](configuration.md)).
74
-
75
- ---
76
-
77
- ## Updating FlowDeck
78
-
79
- ### curl method
80
-
81
- Re-running the install script downloads and applies the latest version:
82
-
83
- ```bash
84
- curl -fsSL https://raw.githubusercontent.com/DVNghiem/flowdeck/main/install.sh | bash
85
- ```
86
-
87
- The script overwrites existing FlowDeck files and updates the plugin cache.
88
-
89
- ### npm method
90
-
91
- ```bash
92
- npm update -g @dv.nghiem/flowdeck && npx @dv.nghiem/flowdeck install
93
- ```
94
-
95
- ---
96
-
97
- ## Uninstalling
98
-
99
- ```bash
100
- bash uninstall.sh
101
- ```
102
- You can also add the `--local` flag to uninstall from a local project `.opencode/` directory instead of the global config.
103
-
104
- The uninstall script automatically scans the FlowDeck package and safely removes any installed agents, skills, and commands from your OpenCode config directory. It does not delete your project's `.planning/` directory or any state files.
105
-
106
- ---
107
-
108
- ## Environment Variables
109
-
110
- | Variable | Default | Description |
111
- |----------|---------|-------------|
112
- | `OPENCODE_CONFIG_DIR` | `~/.config/opencode` | Override the directory where FlowDeck installs agents, skills, and commands |
113
- | `XDG_CONFIG_HOME` | `~/.config` | Standard XDG base directory; used when `OPENCODE_CONFIG_DIR` is not set |
114
-
115
- Set `OPENCODE_CONFIG_DIR` before running the install script to place FlowDeck files in a non-default location:
116
-
117
- ```bash
118
- OPENCODE_CONFIG_DIR=/custom/path bash install.sh
119
- ```
120
-
121
- ---
122
-
123
- ← [Back to Index](index.md)
@@ -1,370 +0,0 @@
1
- # FlowDeck Intelligence Features
2
-
3
- FlowDeck's intelligence layer adds safety-first AI editing, persistent architecture memory, and risk prediction directly into every OpenCode session. These features require no extra setup beyond running `/fd-new-project`.
4
-
5
- ---
6
-
7
- ## Overview
8
-
9
- | Feature | Command / Hook | Storage |
10
- |---------|---------------|---------|
11
- | Change Impact Radar | Integrated analysis workflow | VOLATILITY.json, MEMORY.json |
12
- | Patch Trust Score | Hook (automatic) | VOLATILITY.json, FAILURES.json |
13
- | Blast Radius Preview | Integrated analysis workflow | MEMORY.json, FAILURES.json |
14
- | Repo Memory Graph | `repo-memory` tool | `.codebase/MEMORY.json` |
15
- | Failure Replay Engine | `failure-replay` tool | `.codebase/FAILURES.json` |
16
- | Safe Execution Modes | Hook (automatic) | `.planning/config.json` |
17
- | Test Gap Detector | Integrated analysis workflow | VOLATILITY.json |
18
- | Architectural Constraint Guard | Hook (automatic) | `.codebase/CONSTRAINTS.md` |
19
- | Intent-to-Change Translator | `/fd-translate-intent` | — |
20
- | Confidence-Aware Planning | Skill | — |
21
- | Codebase Volatility Map | `volatility-map` tool | `.codebase/VOLATILITY.json` |
22
- | Human Review Routing | Integrated analysis workflow | VOLATILITY.json, FAILURES.json |
23
- | Regression Prediction | Integrated analysis workflow | — |
24
- | Decision Trace | `decision-trace` tool + hook | `.codebase/DECISIONS.jsonl` |
25
- | Self-Healing Policies | `policy-engine` tool | `.codebase/POLICIES.json` |
26
-
27
- ---
28
-
29
- ## Slash Commands
30
-
31
- ### Change Impact Radar
32
-
33
- Predicts which files, modules, APIs, tests, and database paths are likely to be affected before the AI edits anything.
34
-
35
- Use `/fd-suggest` or `/fd-translate-intent` when you need pre-change analysis with impact context.
36
-
37
- **Arguments:**
38
- - `--change` — describe the proposed change (free text)
39
- - `--scope` — `all` (default), `api`, `db`, `tests`
40
- - `--json` — machine-readable JSON output
41
-
42
- **Output:** Table showing researcher/architect/tester agent roles, known hotspots, and recommended traversal scope.
43
-
44
- ---
45
-
46
- ### Blast Radius Preview
47
-
48
- Shows the likely downstream consequences of a proposed change — hidden dependencies, fragile integration points, and predicted test breakages.
49
-
50
- Use `/fd-suggest` for broad risk discovery and `/fd-deploy-check` before release changes.
51
-
52
- **Arguments:**
53
- - `--change` — describe the proposed change
54
- - `--depth` — dependency traversal hops (default: `2`)
55
- - `--json` — JSON output
56
-
57
- **How it works:** Reads Repo Memory Graph for dependency edges. Cross-references recurring failure patterns from Failure Replay Engine. Spawns architect + researcher + tester agent team.
58
-
59
- ---
60
-
61
- ### `/fd-translate-intent`
62
-
63
- Converts a vague request like "make checkout faster" into concrete, ranked implementation options with tradeoffs **before** any code is written.
64
-
65
- ```
66
- /fd-translate-intent --intent "make checkout faster"
67
- /fd-translate-intent --intent "reduce memory usage on the worker"
68
- ```
69
-
70
- **Arguments:**
71
- - `--intent` — the high-level intent to translate (required)
72
- - `--json` — JSON output
73
-
74
- ---
75
-
76
- ### Volatility Map
77
-
78
- Displays the Codebase Volatility Map — highlights unstable zones based on churn, hotfix frequency, and unresolved TODO clusters.
79
-
80
- Use the `volatility-map` tool directly from delegated agents for incremental updates.
81
-
82
- **Arguments:**
83
- - `--threshold` — minimum stability level to show: `stable`, `moderate`, `volatile` (default), `critical`
84
- - `--limit` — max results
85
- - `--json` — JSON output
86
-
87
- **Populated by:** `/fd-map-codebase` writes initial data; the `volatility-map` tool allows incremental updates.
88
-
89
- ---
90
-
91
- ### Regression Prediction
92
-
93
- Estimates the most likely regression categories for a change — performance, auth, schema, UI states, async flows, etc.
94
-
95
- FlowDeck derives regression risk from historical failures plus volatility data during analysis-oriented workflows.
96
-
97
- **Arguments:**
98
- - `--change` — describe the proposed change
99
- - `--categories` — comma-separated from: `performance`, `auth`, `schema`, `ui-state`, `async-flow`, `api-contract`, `data-integrity`, `security`, `config`, `i18n` (default: `all`)
100
- - `--json` — JSON output
101
-
102
- ---
103
-
104
- ### Test Gap Detector
105
-
106
- Identifies which areas of a proposed change are weakly covered by tests, and suggests the minimum high-value tests to add first.
107
-
108
- Use `/fd-verify` and `/fd-deploy-check` for current test-gap surfacing in production workflows.
109
-
110
- **Arguments:**
111
- - `--change` — describe the proposed change
112
- - `--scope` — `unit`, `integration`, `e2e`, `all` (default)
113
- - `--json` — JSON output
114
-
115
- ---
116
-
117
- ### Human Review Routing
118
-
119
- Routes risky patches to the right reviewer type — security, backend, infra, domain-owner, frontend, data, or devops — based on the file paths and change description.
120
-
121
- Routing to reviewer profiles is integrated into verification and deployment checks.
122
-
123
- **Arguments:**
124
- - `--files` — comma-separated file paths being changed
125
- - `--change` — describe the change
126
- - `--json` — JSON output
127
-
128
- **Routing rules:**
129
- - `security` — auth, token, password, crypto, JWT, RBAC, XSS, SQL keywords; always added for high-risk patches
130
- - `backend` — API, route, controller, migration keywords
131
- - `infra` — Docker, Kubernetes, Terraform, CI/CD keywords
132
- - `domain-owner` — billing, payment, checkout, subscription keywords
133
- - `frontend` — component, CSS, React, Vue keywords
134
- - `data` — schema, migration, index, constraint keywords
135
- - `devops` — pipeline, YAML workflow, cron, schedule keywords
136
-
137
- ---
138
-
139
- ## Automatic Hooks
140
-
141
- These run on every `write` or `edit` tool call with no manual trigger needed.
142
-
143
- ### Patch Trust Score
144
-
145
- Every AI-generated write/edit is scored 0–100:
146
-
147
- | Score | Verdict | Action |
148
- |-------|---------|--------|
149
- | ≥ 80 | `safe` | Auto-apply |
150
- | 40–79 | `review-required` | Logged with signals |
151
- | < 40 | `high-risk` | Warning printed, human review required |
152
-
153
- **Risk signals checked:**
154
- - File is in a `critical` volatility zone (−40 pts)
155
- - File is in a `volatile` zone (−25 pts)
156
- - File has moderate churn (−10 pts)
157
- - File has prior failure history in FAILURES.json (−20 pts)
158
- - Edit content contains high-risk keywords: password, secret, token, auth, crypto, jwt, etc. (−8 pts each, max −30 pts)
159
-
160
- ### Safe Execution Modes
161
-
162
- Automatically selects the editing mode for the session:
163
-
164
- | Mode | When Used |
165
- |------|-----------|
166
- | `auto-edit` | Trust score ≥ 60, low volatility |
167
- | `guarded` | Trust score 30–59, or moderate volatility |
168
- | `review-only` | Trust score < 30, or config override |
169
-
170
- Override by setting `execution_mode` in `.planning/config.json`:
171
- ```json
172
- { "execution_mode": "review-only" }
173
- ```
174
-
175
- ### Architectural Constraint Guard
176
-
177
- Before any write or edit, FlowDeck reads `.codebase/CONSTRAINTS.md` and blocks writes to any path listed under `## Forbidden Paths`.
178
-
179
- **Example `.codebase/CONSTRAINTS.md`:**
180
- ```markdown
181
- ## Forbidden Paths
182
- - src/legacy/
183
- - infra/production/
184
- - db/migrations/
185
- ```
186
-
187
- ### Decision Trace Hook
188
-
189
- Every write or edit automatically appends a minimal entry to `.codebase/DECISIONS.jsonl` recording the tool name, file path, and timestamp. For full entries with rationale, use the `decision-trace` tool explicitly.
190
-
191
- ---
192
-
193
- ## Persistent State Tools
194
-
195
- These tools manage the `.codebase/` directory and can be called directly by agents.
196
-
197
- ### `repo-memory`
198
-
199
- Manages `.codebase/MEMORY.json` — a persistent graph of modules, services, APIs, schemas, and their relationships.
200
-
201
- **Actions:** `read`, `write_node`, `query`, `delete_node`
202
-
203
- **Example:**
204
- ```
205
- repo-memory action=write_node node_id=auth-module node={type:module, path:src/auth, owner:alice, tags:[auth,security], ...}
206
- repo-memory action=query query={type:module, owner:alice}
207
- ```
208
-
209
- ### `failure-replay`
210
-
211
- Manages `.codebase/FAILURES.json` — a log of reverted commits, failed deployments, flaky tests, and bug fixes.
212
-
213
- **Actions:** `record`, `query`, `list`, `mark_resolved`
214
-
215
- **Example:**
216
- ```
217
- failure-replay action=record entry={id:deploy-001, type:failed_deployment, description:"...", affected_paths:[src/auth], tags:[auth]}
218
- failure-replay action=query query={path_prefix:src/auth}
219
- ```
220
-
221
- ### `decision-trace`
222
-
223
- Manages `.codebase/DECISIONS.jsonl` — append-only log of why every change was made.
224
-
225
- **Actions:** `record`, `query`, `get_for_file`
226
-
227
- **Fields:** `file_path`, `change_type`, `rationale`, `evidence[]`, `assumptions[]`, `alternatives_considered[]`, `risk_level`
228
-
229
- ### `volatility-map`
230
-
231
- Manages `.codebase/VOLATILITY.json` — per-file churn and stability data.
232
-
233
- **Actions:** `read`, `write`, `query_hotspots`, `update_entry`
234
-
235
- **Stability labels:** `stable` → `moderate` → `volatile` → `critical` (computed from churn score + hotfix count + TODO count)
236
-
237
- ### `policy-engine`
238
-
239
- Manages `.codebase/POLICIES.json` — self-healing editing rules that update after repeated failures.
240
-
241
- **Actions:** `list`, `add`, `record_violation`, `toggle`, `query`
242
-
243
- ---
244
-
245
- ## `.codebase/` File Reference
246
-
247
- | File | Format | Purpose |
248
- |------|--------|---------|
249
- | `MEMORY.json` | JSON | Repo architecture graph (nodes + edges) |
250
- | `FAILURES.json` | JSON | Failure history and recurrence tracking |
251
- | `DECISIONS.jsonl` | Newline-delimited JSON | Append-only edit rationale log |
252
- | `VOLATILITY.json` | JSON | Per-file churn and stability metrics |
253
- | `POLICIES.json` | JSON | Self-healing editing rule set |
254
- | `CONSTRAINTS.md` | Markdown | Forbidden path list for Arch Constraint Guard |
255
- | `AGENT_SPANS.jsonl` | Newline-delimited JSON | Inter-agent trace graph (governance) |
256
- | `BUDGETS.json` | JSON | Per-run delegation budget state (governance) |
257
- | `DEADLOCK_SIGNALS.jsonl` | Newline-delimited JSON | Detected loops and deadlocks (governance) |
258
- | `SCORECARDS.jsonl` | Newline-delimited JSON | 10-dimension workflow quality scores (governance) |
259
-
260
- > **Tip:** All `.codebase/` files should be committed to version control so the intelligence layer improves over time.
261
-
262
- ---
263
-
264
- ## Governance Layer
265
-
266
- The governance layer makes multi-agent execution trustworthy and debuggable. It runs automatically as internal runtime services — no commands or manual wiring needed.
267
-
268
- ### Agent Contracts
269
-
270
- Every major agent has an explicit contract defining:
271
-
272
- - **Allowed tools** — tools the agent may invoke
273
- - **Forbidden actions** — things the agent must never do (e.g. `@reviewer` may not write files)
274
- - **Required inputs** — what context must be present before the agent runs
275
- - **Escalation conditions** — when to surface to human review
276
- - **Success criteria** — what a good output looks like
277
-
278
- Contracts are defined in `src/services/agent-contract-registry.ts` and cover: orchestrator, planner, plan-checker, design, backend-coder, frontend-coder, devops, tester, reviewer, security-auditor, researcher, architect, writer, and doc-updater.
279
-
280
- ### Agent Validator
281
-
282
- Before and after each agent invocation, the validator checks the execution context against the agent's contract. Configure the enforcement mode in `flowdeck.json`:
283
-
284
- | Mode | Behaviour |
285
- |------|-----------|
286
- | `off` | Validation disabled |
287
- | `advisory` | Validate and warn; never block execution (default) |
288
- | `strict` | Block on contract violations of severity `block` |
289
-
290
- Violations are emitted as `contract.violation` telemetry events and attached to the agent span.
291
-
292
- ### Inter-Agent Trace Graph
293
-
294
- Every delegation opens a **span** in the trace graph. Spans record:
295
-
296
- - Invoker → agent direction
297
- - Trace ID and parent span ID (causal chain)
298
- - Tools used and outputs
299
- - Contract violations attached to the span
300
- - Latency and delegation depth
301
-
302
- Spans are stored in `.codebase/AGENT_SPANS.jsonl`. The trace graph is dashboard-ready and can be rendered as a timeline, causality graph, or per-agent drilldown.
303
-
304
- ### Delegation Budget
305
-
306
- Each workflow run has a budget tracked in `.codebase/BUDGETS.json`:
307
-
308
- | Limit | Default | Config key |
309
- |-------|---------|------------|
310
- | Max tool calls | 200 | `governance.delegationBudget.maxToolCalls` |
311
- | Max delegated agents | 30 | `governance.delegationBudget.maxDelegatedAgents` |
312
- | Max retries (total) | 10 | `governance.delegationBudget.maxRetries` |
313
- | Max delegation depth | 8 | `governance.delegationBudget.maxDepth` |
314
- | Max retries per step | 3 | `governance.delegationBudget.maxSameStepRetries` |
315
-
316
- When a limit is exceeded the system escalates to human review or (if `autoStop: true`) stops safely and summarises what was completed.
317
-
318
- ### Deadlock and Loop Detector
319
-
320
- The detector runs four independent pattern checks after each agent invocation:
321
-
322
- | Pattern | Trigger |
323
- |---------|---------|
324
- | `agent_bounce` | Same agent pair invoked ≥ N times without resolution |
325
- | `step_retry_loop` | Same stage retried beyond the per-step limit |
326
- | `circular_delegation` | DFS detects a cycle in the delegation graph — always triggers `auto_stop` |
327
- | `stage_stall` | Workflow stage makes no progress within the stall window |
328
-
329
- Signals are written to `.codebase/DEADLOCK_SIGNALS.jsonl`. Duplicate signals for the same trace and pattern are suppressed. A recovery action recommendation is attached to each signal.
330
-
331
- ### Workflow Scorecard
332
-
333
- After every completed or failed run, a scorecard is generated and appended to `.codebase/SCORECARDS.jsonl`. Ten dimensions are scored and combined into a weighted 0–100 score:
334
-
335
- | Dimension | Weight |
336
- |-----------|--------|
337
- | Stage compliance | 15% |
338
- | TDD compliance | 15% |
339
- | Design-first compliance | 10% |
340
- | Approval compliance | 10% |
341
- | Review quality | 10% |
342
- | Handoff quality | 10% |
343
- | Budget efficiency | 10% |
344
- | Tool reliability | 10% |
345
- | Policy compliance | 5% |
346
- | Override frequency | 5% |
347
-
348
- Scorecards support trend analysis over time. Use `getScorecardTrend(dir, command)` and `computeAverageScore(dir)` from `src/services/workflow-scorecard.ts` to query them programmatically.
349
-
350
- ---
351
-
352
-
353
- Each intelligence feature also has a corresponding skill that gives the OpenCode agent detailed workflow instructions. Skills are installed automatically by `install.sh`.
354
-
355
- | Skill | Name |
356
- |-------|------|
357
- | `change-impact-radar` | Change Impact Radar |
358
- | `patch-trust-score` | Patch Trust Score |
359
- | `blast-radius-preview` | Blast Radius Preview |
360
- | `repo-memory-graph` | Repo Memory Graph |
361
- | `failure-replay-engine` | Failure Replay Engine |
362
- | `test-gap-detector` | Test Gap Detector |
363
- | `arch-constraint-guard` | Architectural Constraint Guard |
364
- | `intent-translator` | Intent-to-Change Translator |
365
- | `confidence-aware-planning` | Confidence-Aware Planning |
366
- | `volatility-map` | Codebase Volatility Map |
367
- | `human-review-routing` | Human Review Routing |
368
- | `regression-prediction` | Regression Prediction |
369
- | `decision-trace` | Decision Trace |
370
- | `self-healing-policies` | Self-Healing Prompt Policies |
package/docs/memory.md DELETED
@@ -1,69 +0,0 @@
1
- # Memory System
2
-
3
- FlowDeck includes a persistent memory system that stores tool executions, assistant messages, and session summaries. This helps agents recall what was worked on in previous sessions.
4
-
5
- ## How It Works
6
-
7
- Memory is automatically captured during sessions:
8
-
9
- 1. **Session Start** — Session is registered with project directory
10
- 2. **Tool Execution** — Every tool call (Read, Write, Edit, Bash, etc.) is stored
11
- 3. **Assistant Messages** — Agent responses are captured
12
- 4. **Session Compact/Summary** — End-of-session summaries are stored
13
-
14
- ## Storage
15
-
16
- - **Location**: `~/.flowdeck-memory/memory.db`
17
- - **Format**: SQLite database (using `bun:sqlite`)
18
- - **Tables**:
19
- - `sessions` — Session metadata (project, directory, timestamps)
20
- - `observations` — Tool executions and messages
21
- - `summaries` — Session summaries
22
-
23
- ## Using Memory
24
-
25
- ### Search Tool
26
-
27
- Use the `memory-search` tool to query past observations:
28
-
29
- ```
30
- tool: memory-search
31
- args: { query: "authentication", limit: 5 }
32
- ```
33
-
34
- **Arguments:**
35
- - `query` (optional) — Search text for tool names, inputs, and outputs
36
- - `session_id` (optional) — Retrieve all observations from a specific session
37
- - `limit` (optional) — Max results (default: 10)
38
-
39
- ### Example Queries
40
-
41
- ```javascript
42
- // Search for specific work
43
- tool: memory-search
44
- args: { query: "Redis cache" }
45
-
46
- // Get recent sessions
47
- tool: memory-search
48
- args: { limit: 10 }
49
-
50
- // Get all observations from a session
51
- tool: memory-search
52
- args: { session_id: "abc-123" }
53
- ```
54
-
55
- ## Context Injection
56
-
57
- When a new session starts in the same directory, FlowDeck can optionally inject relevant context from previous sessions. This helps maintain continuity across sessions.
58
-
59
- ## Privacy
60
-
61
- - Memory is stored per-user at `~/.flowdeck-memory/`
62
- - Each project directory has its own session tracking
63
- - Use session.delete event to remove specific sessions
64
-
65
- ## Configuration
66
-
67
- No configuration required — memory is enabled by default.
68
-
69
- To disable memory tracking for a project, you would need to modify the session tracking hooks in the FlowDeck plugin configuration.