@fluentcommerce/ai-skills 0.1.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.
- package/LICENSE +21 -0
- package/README.md +622 -0
- package/bin/cli.mjs +1973 -0
- package/content/cli/agents/fluent-cli/agent.json +149 -0
- package/content/cli/agents/fluent-cli.md +132 -0
- package/content/cli/skills/fluent-bootstrap/SKILL.md +181 -0
- package/content/cli/skills/fluent-cli-index/SKILL.md +63 -0
- package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +77 -0
- package/content/cli/skills/fluent-cli-reference/SKILL.md +1031 -0
- package/content/cli/skills/fluent-cli-retailer/SKILL.md +85 -0
- package/content/cli/skills/fluent-cli-settings/SKILL.md +106 -0
- package/content/cli/skills/fluent-connect/SKILL.md +886 -0
- package/content/cli/skills/fluent-module-deploy/SKILL.md +349 -0
- package/content/cli/skills/fluent-profile/SKILL.md +180 -0
- package/content/cli/skills/fluent-workflow/SKILL.md +310 -0
- package/content/dev/agents/fluent-dev/agent.json +88 -0
- package/content/dev/agents/fluent-dev.md +525 -0
- package/content/dev/reference-modules/catalog.json +4754 -0
- package/content/dev/skills/fluent-build/SKILL.md +192 -0
- package/content/dev/skills/fluent-connection-analysis/SKILL.md +386 -0
- package/content/dev/skills/fluent-custom-code/SKILL.md +895 -0
- package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +714 -0
- package/content/dev/skills/fluent-e2e-test/SKILL.md +394 -0
- package/content/dev/skills/fluent-event-api/SKILL.md +945 -0
- package/content/dev/skills/fluent-feature-explain/SKILL.md +603 -0
- package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +695 -0
- package/content/dev/skills/fluent-feature-plan/SKILL.md +227 -0
- package/content/dev/skills/fluent-job-batch/SKILL.md +138 -0
- package/content/dev/skills/fluent-mermaid-validate/SKILL.md +86 -0
- package/content/dev/skills/fluent-module-scaffold/SKILL.md +1928 -0
- package/content/dev/skills/fluent-module-validate/SKILL.md +775 -0
- package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1108 -0
- package/content/dev/skills/fluent-retailer-config/SKILL.md +1111 -0
- package/content/dev/skills/fluent-rule-scaffold/SKILL.md +385 -0
- package/content/dev/skills/fluent-scope-decompose/SKILL.md +1021 -0
- package/content/dev/skills/fluent-session-audit-export/SKILL.md +632 -0
- package/content/dev/skills/fluent-session-summary/SKILL.md +195 -0
- package/content/dev/skills/fluent-settings/SKILL.md +1058 -0
- package/content/dev/skills/fluent-source-onboard/SKILL.md +632 -0
- package/content/dev/skills/fluent-system-monitoring/SKILL.md +767 -0
- package/content/dev/skills/fluent-test-data/SKILL.md +513 -0
- package/content/dev/skills/fluent-trace/SKILL.md +1143 -0
- package/content/dev/skills/fluent-transition-api/SKILL.md +346 -0
- package/content/dev/skills/fluent-version-manage/SKILL.md +744 -0
- package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +959 -0
- package/content/dev/skills/fluent-workflow-builder/SKILL.md +319 -0
- package/content/dev/skills/fluent-workflow-deploy/SKILL.md +267 -0
- package/content/mcp-extn/agents/fluent-mcp.md +69 -0
- package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +461 -0
- package/content/mcp-official/agents/fluent-mcp-core.md +91 -0
- package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -0
- package/content/rfl/agents/fluent-rfl.md +56 -0
- package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -0
- package/docs/CAPABILITY_MAP.md +77 -0
- package/docs/CLI_COVERAGE.md +47 -0
- package/docs/DEV_WORKFLOW.md +802 -0
- package/docs/FLOW_RUN.md +142 -0
- package/docs/USE_CASES.md +404 -0
- package/metadata.json +156 -0
- package/package.json +51 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fluent-session-audit-export
|
|
3
|
+
description: Export a structured JSON audit trail of all session changes. Covers code modifications, Fluent environment mutations, events sent, deployments, and compliance metadata. Machine-readable companion to /fluent-session-summary. Triggers on "export audit", "session audit", "audit trail", "export changes", "compliance report".
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash, Read, Write, Glob, Grep
|
|
6
|
+
argument-hint: [--format json|jsonl] [--output <path>] [--include-readonly]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Session Audit Export
|
|
10
|
+
|
|
11
|
+
Export the session's complete change history as a structured JSON document. Captures code changes, Fluent environment mutations, events sent, deployments, test results, and compliance metadata in a machine-readable format.
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
This skill produces the **machine-readable audit trail** for the ADD Feedback Loop (Phase 7) and compliance reporting. Every write operation performed during a session is captured as a typed change record with full provenance: which tool was called, which skill invoked it, what the previous and new state was, and whether the action is reversible.
|
|
16
|
+
|
|
17
|
+
The JSON output is designed for consumption by CI/CD pipelines, audit systems, Jira integrations, Confluence deployment records, and the ADD feedback loop's scope-completion measurement.
|
|
18
|
+
|
|
19
|
+
## Ownership Boundary
|
|
20
|
+
|
|
21
|
+
This skill owns the **JSON export format** and the serialization of tracked changes into the audit document schema.
|
|
22
|
+
|
|
23
|
+
It does NOT own the tracking itself. The running change log is a cross-cutting concern shared with `/fluent-session-summary`. Both skills read the same underlying tracking data maintained by the agent throughout the session. This skill never maintains a separate tracking log.
|
|
24
|
+
|
|
25
|
+
Related skills:
|
|
26
|
+
- Human-readable session report -> `/fluent-session-summary`
|
|
27
|
+
- Scope document and task tracking -> `/fluent-scope-decompose`
|
|
28
|
+
- Pre-deploy gate results -> `/fluent-pre-deploy-check`
|
|
29
|
+
- Version lifecycle -> `/fluent-version-manage`
|
|
30
|
+
|
|
31
|
+
## When to Use
|
|
32
|
+
|
|
33
|
+
- **End of session** -- export a complete record of everything that was changed
|
|
34
|
+
- **CI/CD integration** -- produce a gate artifact that downstream pipelines can parse
|
|
35
|
+
- **Compliance reporting** -- generate traceability from user stories to deployed changes
|
|
36
|
+
- **ADD feedback loop** -- measure scope completion (tasks completed vs total)
|
|
37
|
+
- **Post-incident review** -- reconstruct exactly what was deployed and when
|
|
38
|
+
- **Handover documentation** -- provide the next engineer with a precise change manifest
|
|
39
|
+
|
|
40
|
+
## Relationship to `/fluent-session-summary`
|
|
41
|
+
|
|
42
|
+
| Aspect | `/fluent-session-summary` | `/fluent-session-audit-export` |
|
|
43
|
+
|--------|--------------------------|-------------------------------|
|
|
44
|
+
| Format | Human-readable Markdown tables | Machine-readable JSON / JSONL |
|
|
45
|
+
| Audience | Developer reviewing session in terminal | CI/CD pipelines, audit systems, feedback loops |
|
|
46
|
+
| Detail level | Grouped summary tables with counts | Per-operation records with full metadata |
|
|
47
|
+
| Compliance | Flags irreversible actions in prose | Story-to-change traceability matrix, pre-deploy checklist cross-ref |
|
|
48
|
+
| Rollback info | Lists irreversible actions prominently | Includes concrete rollback command strings per change |
|
|
49
|
+
| Previous/new values | Key fields noted in "Details" column | Structured `previousValue` / `newValue` fields |
|
|
50
|
+
| Tool attribution | Not included | MCP tool name and skill name per change |
|
|
51
|
+
| Invocation | `/fluent-session-summary show` | `/fluent-session-audit-export` |
|
|
52
|
+
| Data source | Shared tracking log | Same shared tracking log |
|
|
53
|
+
|
|
54
|
+
Both skills consume the same underlying change tracking data. They MUST NOT maintain separate tracking logs. The audit export reads the same data that session-summary presents, then serializes it into the structured schema below.
|
|
55
|
+
|
|
56
|
+
## Inputs
|
|
57
|
+
|
|
58
|
+
| Parameter | Required | Default | Description |
|
|
59
|
+
|-----------|----------|---------|-------------|
|
|
60
|
+
| `--format` | No | `json` | Output format: `json` (single document) or `jsonl` (one change record per line) |
|
|
61
|
+
| `--output` | No | Auto-generated path | Output file path. Default: `accounts/<PROFILE>/analysis/session-audit/<sessionId>.audit.json` |
|
|
62
|
+
| `--include-readonly` | No | `false` | Include read-only operations (queries, downloads, introspection). By default only write operations are tracked. |
|
|
63
|
+
| `--profile` | No | Active profile | Profile context for the audit. Determines the output directory. |
|
|
64
|
+
|
|
65
|
+
## Audit Document JSON Schema
|
|
66
|
+
|
|
67
|
+
The complete schema for the exported JSON document. Every field, type, and enum value is specified.
|
|
68
|
+
|
|
69
|
+
### Top-Level Structure
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"$schema": "fluent-session-audit/v1",
|
|
74
|
+
"sessionId": "string (UUID v4)",
|
|
75
|
+
"startedAt": "string (ISO-8601 timestamp of first tracked change)",
|
|
76
|
+
"endedAt": "string (ISO-8601 timestamp of last tracked change)",
|
|
77
|
+
"context": {
|
|
78
|
+
"profile": "string (Fluent CLI profile name, e.g. HMDEV)",
|
|
79
|
+
"account": "string (API base URL, e.g. hmdev.sandbox.api.fluentretail.com)",
|
|
80
|
+
"retailer": {
|
|
81
|
+
"ref": "string (retailer reference, e.g. HM_TEST)",
|
|
82
|
+
"id": "number (retailer ID, e.g. 5)"
|
|
83
|
+
},
|
|
84
|
+
"user": "string (authenticated username, e.g. admin@hmdev)",
|
|
85
|
+
"agentModel": "string (AI model identifier, e.g. claude-opus-4-6)"
|
|
86
|
+
},
|
|
87
|
+
"summary": {
|
|
88
|
+
"codeChanges": "number (total CODE category changes)",
|
|
89
|
+
"environmentMutations": "number (total ENVIRONMENT category changes)",
|
|
90
|
+
"eventsSent": "number (total EVENT actions)",
|
|
91
|
+
"deploymentsCompleted": "number (total DEPLOY actions)",
|
|
92
|
+
"testsRun": "number (total TEST category changes)",
|
|
93
|
+
"testsPassed": "number (tests with result=PASS)",
|
|
94
|
+
"testsFailed": "number (tests with result=FAIL)",
|
|
95
|
+
"irreversibleActions": "number (changes where reversible=false)"
|
|
96
|
+
},
|
|
97
|
+
"changes": ["array of Change objects (see below)"],
|
|
98
|
+
"compliance": {
|
|
99
|
+
"scopeDocumentRef": "string|null (path to scope document if available)",
|
|
100
|
+
"tasksCompleted": "number (completed tasks from scope decomposition)",
|
|
101
|
+
"tasksTotal": "number (total tasks from scope decomposition)",
|
|
102
|
+
"traceability": {
|
|
103
|
+
"<storyRef>": {
|
|
104
|
+
"tasks": ["array of task IDs (e.g. T-001, T-002)"],
|
|
105
|
+
"status": "string (complete|partial|not_started)",
|
|
106
|
+
"changes": ["array of seq numbers from the changes array"]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"preDeployChecklist": "string|null (path to pre-deploy checklist JSON if available)",
|
|
110
|
+
"irreversibleActions": [
|
|
111
|
+
{
|
|
112
|
+
"seq": "number (references changes[].seq)",
|
|
113
|
+
"description": "string (human-readable explanation)",
|
|
114
|
+
"risk": "string (LOW|MEDIUM|HIGH|CRITICAL)"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Change Object Schema
|
|
122
|
+
|
|
123
|
+
Each entry in the `changes` array has this structure:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"seq": "number (1-based sequential identifier, monotonically increasing)",
|
|
128
|
+
"timestamp": "string (ISO-8601 timestamp of when the change was made)",
|
|
129
|
+
"category": "string (CODE|ENVIRONMENT|TEST|CONFIG)",
|
|
130
|
+
"action": "string (depends on category, see table below)",
|
|
131
|
+
"target": {
|
|
132
|
+
"type": "string (depends on category and action, see table below)",
|
|
133
|
+
"...additional fields depending on type"
|
|
134
|
+
},
|
|
135
|
+
"details": "string (human-readable description of the change)",
|
|
136
|
+
"reversible": "boolean (true if the change can be undone)",
|
|
137
|
+
"rollbackCommand": "string|undefined (concrete command to reverse the change, only when reversible=true and a command is known)",
|
|
138
|
+
"outcome": "string|undefined (SUCCESS|FAILED|NO_MATCH|PENDING -- for events and mutations)",
|
|
139
|
+
"previousValue": "any|undefined (previous state, for mutations and setting updates)",
|
|
140
|
+
"newValue": "any|undefined (new state, for mutations and setting updates)",
|
|
141
|
+
"diff": {
|
|
142
|
+
"linesAdded": "number",
|
|
143
|
+
"linesRemoved": "number"
|
|
144
|
+
},
|
|
145
|
+
"result": "string|undefined (PASS|FAIL -- for TEST category)",
|
|
146
|
+
"tool": "string|undefined (MCP tool name, e.g. event.send, entity.update, graphql.query)",
|
|
147
|
+
"skill": "string|undefined (skill that triggered this change, e.g. fluent-e2e-test)",
|
|
148
|
+
"storyRef": "string|undefined (user story identifier, e.g. US-301)"
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Note: Fields marked `|undefined` are only present when applicable to the specific change type. The `diff` object is only present for CODE MODIFY actions.
|
|
153
|
+
|
|
154
|
+
### Target Object Shapes by Category
|
|
155
|
+
|
|
156
|
+
**CODE targets:**
|
|
157
|
+
|
|
158
|
+
| Action | target.type | Additional target fields |
|
|
159
|
+
|--------|-------------|------------------------|
|
|
160
|
+
| `CREATE` | `file` | `path` (string -- absolute file path) |
|
|
161
|
+
| `MODIFY` | `file` | `path` (string -- absolute file path) |
|
|
162
|
+
| `DELETE` | `file` | `path` (string -- absolute file path) |
|
|
163
|
+
| `COMMIT` | `git` | `repo` (string), `branch` (string), `hash` (string -- short commit hash) |
|
|
164
|
+
| `PUSH` | `git` | `repo` (string), `branch` (string), `remote` (string -- e.g. origin) |
|
|
165
|
+
|
|
166
|
+
**ENVIRONMENT targets:**
|
|
167
|
+
|
|
168
|
+
| Action | target.type | Additional target fields |
|
|
169
|
+
|--------|-------------|------------------------|
|
|
170
|
+
| `MUTATION` | `entity` | `entityType` (string -- ORDER, FULFILMENT, LOCATION, etc.), `entityRef` (string), `entityId` (string\|number), `fields` (string[] -- which fields were changed) |
|
|
171
|
+
| `DEPLOY` | `module` | `name` (string), `version` (string), `retailer` (string) |
|
|
172
|
+
| `DEPLOY` | `workflow` | `name` (string -- e.g. ORDER::HD), `version` (number), `retailer` (string) |
|
|
173
|
+
| `EVENT` | `event` | `eventName` (string), `entityType` (string), `entityRef` (string), `mode` (string -- async\|sync) |
|
|
174
|
+
| `BATCH` | `batch` | `jobName` (string), `jobId` (string), `entityType` (string), `recordCount` (number) |
|
|
175
|
+
|
|
176
|
+
**TEST targets:**
|
|
177
|
+
|
|
178
|
+
| Action | target.type | Additional target fields |
|
|
179
|
+
|--------|-------------|------------------------|
|
|
180
|
+
| `ASSERT` | `assertion` | `entityType` (string), `entityRef` (string), `expectedStatus` (string), `actualStatus` (string) |
|
|
181
|
+
| `BUILD` | `build` | `command` (string -- e.g. mvn clean install), `exitCode` (number), `testCount` (number), `failureCount` (number) |
|
|
182
|
+
| `VALIDATE` | `validation` | `validationType` (string -- module\|workflow\|environment), `target` (string -- what was validated) |
|
|
183
|
+
|
|
184
|
+
**CONFIG targets:**
|
|
185
|
+
|
|
186
|
+
| Action | target.type | Additional target fields |
|
|
187
|
+
|--------|-------------|------------------------|
|
|
188
|
+
| `SETTING_CREATE` | `setting` | `key` (string), `context` (string -- RETAILER\|ACCOUNT\|LOCATION), `contextId` (number) |
|
|
189
|
+
| `SETTING_UPDATE` | `setting` | `key` (string), `context` (string), `contextId` (number) |
|
|
190
|
+
|
|
191
|
+
### Action Enum Values by Category
|
|
192
|
+
|
|
193
|
+
| Category | Valid Actions |
|
|
194
|
+
|----------|-------------|
|
|
195
|
+
| `CODE` | `CREATE`, `MODIFY`, `DELETE`, `COMMIT`, `PUSH` |
|
|
196
|
+
| `ENVIRONMENT` | `MUTATION`, `DEPLOY`, `EVENT`, `BATCH` |
|
|
197
|
+
| `TEST` | `ASSERT`, `BUILD`, `VALIDATE` |
|
|
198
|
+
| `CONFIG` | `SETTING_CREATE`, `SETTING_UPDATE` |
|
|
199
|
+
|
|
200
|
+
## Change Categories
|
|
201
|
+
|
|
202
|
+
What falls under each category:
|
|
203
|
+
|
|
204
|
+
| Category | Source Operations | Tracked From |
|
|
205
|
+
|----------|-----------------|-------------|
|
|
206
|
+
| `CODE` | File creates/edits/deletes, git commits, git pushes, workflow JSON edits, rule class scaffolding | File system operations via Write/Edit tools, git commands via Bash |
|
|
207
|
+
| `ENVIRONMENT` | GraphQL mutations, entity CRUD, event sends, workflow uploads, module deploys, batch job creates/sends | MCP tool calls: `graphql.query` (mutations), `entity.create`, `entity.update`, `event.send`, `workflow.upload`, `batch.create`, `batch.send`, `graphql.batchMutate` |
|
|
208
|
+
| `TEST` | Assertions on entity state, build results, module/workflow validation | MCP tool calls: `test.assert`, Bash `mvn` commands, `environment.validate` |
|
|
209
|
+
| `CONFIG` | Setting creates and updates | MCP tool calls: `setting.upsert`, `setting.bulkUpsert` |
|
|
210
|
+
|
|
211
|
+
## Capture Mechanism
|
|
212
|
+
|
|
213
|
+
The audit trail is built from the same tracking protocol used by `/fluent-session-summary`. The agent maintains a running log of write operations throughout the session. Both skills read from this same log.
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
1. DURING THE SESSION:
|
|
217
|
+
- After each write operation (mutation, event send, deploy, file edit, commit),
|
|
218
|
+
the agent appends it to the running change log
|
|
219
|
+
- This is the same protocol described in /fluent-session-summary
|
|
220
|
+
- Read-only operations (queries, downloads, introspection) are NOT logged
|
|
221
|
+
unless --include-readonly is specified
|
|
222
|
+
|
|
223
|
+
2. ON /fluent-session-audit-export INVOCATION:
|
|
224
|
+
a. Compile all tracked changes into the JSON schema
|
|
225
|
+
b. For each ENVIRONMENT change, capture:
|
|
226
|
+
- MCP tool name used (e.g. event.send, entity.update)
|
|
227
|
+
- Response status (ok/error mapped to outcome)
|
|
228
|
+
- Previous vs new state where available
|
|
229
|
+
c. For each CODE change:
|
|
230
|
+
- Absolute file path
|
|
231
|
+
- Action type (CREATE/MODIFY/DELETE)
|
|
232
|
+
- Line count delta (if available)
|
|
233
|
+
- Associated skill name
|
|
234
|
+
d. For each TEST change:
|
|
235
|
+
- Assertion details and PASS/FAIL result
|
|
236
|
+
- Build results with test counts
|
|
237
|
+
e. For each CONFIG change:
|
|
238
|
+
- Setting key, context, contextId
|
|
239
|
+
- Previous and new values
|
|
240
|
+
f. Add compliance section if scope document is available
|
|
241
|
+
g. Assign sequential seq numbers (1-based, monotonically increasing)
|
|
242
|
+
h. Compute summary counts
|
|
243
|
+
|
|
244
|
+
3. WRITE to output path:
|
|
245
|
+
Default: accounts/<PROFILE>/analysis/session-audit/<sessionId>.audit.json
|
|
246
|
+
Or: user-specified --output path
|
|
247
|
+
|
|
248
|
+
4. REPORT: Print the output file path and summary counts to the terminal
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Sensitive Value Redaction
|
|
252
|
+
|
|
253
|
+
Certain values MUST be redacted before writing the audit document:
|
|
254
|
+
|
|
255
|
+
**Always redact (replace with `"[REDACTED]"`):**
|
|
256
|
+
- Access tokens and bearer tokens
|
|
257
|
+
- Passwords and client secrets
|
|
258
|
+
- API keys
|
|
259
|
+
- PII: customer email addresses, phone numbers, full names in entity attributes
|
|
260
|
+
- Setting values containing `password`, `secret`, `token`, `key` in the setting name
|
|
261
|
+
|
|
262
|
+
**Never redact (keep as-is):**
|
|
263
|
+
- Entity refs, IDs, and statuses
|
|
264
|
+
- Event names and entity types
|
|
265
|
+
- File paths
|
|
266
|
+
- Version numbers
|
|
267
|
+
- Workflow names and ruleset names
|
|
268
|
+
- Setting keys (the name itself, not secret values)
|
|
269
|
+
- Retailer refs and IDs
|
|
270
|
+
- User story references
|
|
271
|
+
- Git commit hashes and branch names
|
|
272
|
+
|
|
273
|
+
## Rollback Commands
|
|
274
|
+
|
|
275
|
+
For each reversible change, include a concrete `rollbackCommand` string when one can be determined:
|
|
276
|
+
|
|
277
|
+
| Action | Rollback Command Pattern |
|
|
278
|
+
|--------|------------------------|
|
|
279
|
+
| `DEPLOY` (module) | `fluent module install -p <PROFILE> -r <RETAILER> -m <module-name>:<previousVersion>` |
|
|
280
|
+
| `DEPLOY` (workflow) | Re-upload the previous version workflow JSON via `workflow.upload` |
|
|
281
|
+
| `MUTATION` (entity status) | `entity.update({ entityType, id, fields: { status: "<previousValue>" } })` |
|
|
282
|
+
| `SETTING_CREATE` | Delete the setting (note: no MCP tool for this; manual via GraphQL) |
|
|
283
|
+
| `SETTING_UPDATE` | `setting.upsert({ name, value: "<previousValue>", context, contextId })` |
|
|
284
|
+
| `COMMIT` | `git revert <hash>` |
|
|
285
|
+
| `PUSH` | `git push origin <branch> --force` (flag as destructive) |
|
|
286
|
+
| `EVENT` | Not reversible -- events cannot be un-sent |
|
|
287
|
+
| `BATCH` | Not reversible -- batch records are processed |
|
|
288
|
+
| `CODE CREATE` | `rm <path>` or `git checkout -- <path>` |
|
|
289
|
+
| `CODE MODIFY` | `git checkout -- <path>` |
|
|
290
|
+
|
|
291
|
+
Changes with `reversible: false` do not have a `rollbackCommand` field.
|
|
292
|
+
|
|
293
|
+
## Output Paths
|
|
294
|
+
|
|
295
|
+
Default output location follows the accounts directory convention:
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
accounts/<PROFILE>/analysis/session-audit/<sessionId>.audit.json
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
When `--output` is specified, write to that path instead.
|
|
302
|
+
|
|
303
|
+
If the output directory does not exist, create it.
|
|
304
|
+
|
|
305
|
+
## JSONL Format Option
|
|
306
|
+
|
|
307
|
+
When `--format jsonl` is specified, output one JSON object per line instead of a single document:
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
Line 1: {"$schema":"fluent-session-audit/v1","sessionId":"...","startedAt":"...","endedAt":"...","context":{...},"summary":{...},"compliance":{...}}
|
|
311
|
+
Line 2: {"seq":1,"timestamp":"...","category":"CODE","action":"CREATE","target":{...},...}
|
|
312
|
+
Line 3: {"seq":2,"timestamp":"...","category":"CODE","action":"MODIFY","target":{...},...}
|
|
313
|
+
...
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
The first line is the session metadata (everything except the `changes` array). Each subsequent line is one change record. This format supports streaming consumption and line-by-line processing by CI/CD tools.
|
|
317
|
+
|
|
318
|
+
The file extension for JSONL output is `.audit.jsonl`.
|
|
319
|
+
|
|
320
|
+
## External System Mapping
|
|
321
|
+
|
|
322
|
+
The audit JSON is designed for consumption by external systems:
|
|
323
|
+
|
|
324
|
+
| System | Field Mapping | Consumption Pattern |
|
|
325
|
+
|--------|--------------|-------------------|
|
|
326
|
+
| **Jira** | `changes[].storyRef` maps to Jira issue keys (e.g. US-301 -> PROJ-301) | Create work log entries from changes; update story status based on `compliance.traceability[].status` |
|
|
327
|
+
| **Confluence** | Full audit document | Generate deployment record pages; attach as artifact to release pages |
|
|
328
|
+
| **CI/CD** | `compliance.irreversibleActions`, `summary.testsFailed` | Parse audit as deployment gate artifact; fail pipeline if irreversible action count exceeds threshold or tests failed |
|
|
329
|
+
| **Git** | `changes[].target` where `target.type == "git"` | Cross-reference COMMIT entries with PR metadata; verify all commits are in a merged PR |
|
|
330
|
+
| **ADD Feedback Loop** | `compliance.tasksCompleted` / `compliance.tasksTotal` | Measure scope completion percentage; track velocity across sessions |
|
|
331
|
+
|
|
332
|
+
## Edge Cases
|
|
333
|
+
|
|
334
|
+
- **No changes made:** Output a valid audit document with an empty `changes` array and all summary counts at 0. Set `startedAt` and `endedAt` to the current timestamp.
|
|
335
|
+
- **Multi-retailer sessions:** If the session spans multiple profiles or retailers, produce one audit document per profile/retailer combination. Each document's `context` reflects its specific target.
|
|
336
|
+
- **Failed writes:** Track with `outcome: "FAILED"` in the change record. Failed operations are still part of the audit trail -- they represent attempted changes.
|
|
337
|
+
- **Dry-run operations:** `event.send` with `dryRun: true`, `entity.create` with `dryRun: true`, and `workflow.upload` with `dryRun: true` are NOT tracked. Dry runs do not change state.
|
|
338
|
+
- **Partial sessions:** If the agent session ends abnormally (timeout, error), the audit captures everything tracked up to that point. The `endedAt` reflects the last tracked change, not the session end.
|
|
339
|
+
- **No scope document:** If no scope decomposition was run, set `compliance.scopeDocumentRef` to `null`, `tasksCompleted` and `tasksTotal` to 0, and `traceability` to an empty object.
|
|
340
|
+
- **No pre-deploy checklist:** If no pre-deploy check was run, set `compliance.preDeployChecklist` to `null`.
|
|
341
|
+
- **Setting bulk upserts:** Each individual setting in a `setting.bulkUpsert` call is tracked as a separate CONFIG change record.
|
|
342
|
+
|
|
343
|
+
## Integration with `/fluent-session-summary`
|
|
344
|
+
|
|
345
|
+
Both skills share the same tracking protocol and read the same data:
|
|
346
|
+
|
|
347
|
+
| Concern | Implementation |
|
|
348
|
+
|---------|---------------|
|
|
349
|
+
| Tracking log | Single running log maintained by the agent during the session |
|
|
350
|
+
| Data ownership | Neither skill owns the log -- it is a cross-cutting concern |
|
|
351
|
+
| Invocation independence | Either skill can be invoked without the other |
|
|
352
|
+
| Consistent counts | Both skills must produce the same counts for the same data |
|
|
353
|
+
| Ordering | Both skills order changes chronologically by timestamp |
|
|
354
|
+
|
|
355
|
+
When both are invoked in the same session, the text summary from `/fluent-session-summary` and the JSON from `/fluent-session-audit-export` represent the same underlying changes. Any discrepancy is a bug.
|
|
356
|
+
|
|
357
|
+
## Full Example Audit Document
|
|
358
|
+
|
|
359
|
+
This example shows a realistic session that scaffolds a rule, configures settings, deploys a module and workflow, runs an E2E test, and commits the code.
|
|
360
|
+
|
|
361
|
+
```json
|
|
362
|
+
{
|
|
363
|
+
"$schema": "fluent-session-audit/v1",
|
|
364
|
+
"sessionId": "a3f1c9e2-7b4d-4e8a-9f12-d6c3a8b5e7f1",
|
|
365
|
+
"startedAt": "2026-02-23T09:00:12Z",
|
|
366
|
+
"endedAt": "2026-02-23T11:42:08Z",
|
|
367
|
+
"context": {
|
|
368
|
+
"profile": "HMDEV",
|
|
369
|
+
"account": "hmdev.sandbox.api.fluentretail.com",
|
|
370
|
+
"retailer": {
|
|
371
|
+
"ref": "HM_TEST",
|
|
372
|
+
"id": 5
|
|
373
|
+
},
|
|
374
|
+
"user": "admin@hmdev",
|
|
375
|
+
"agentModel": "claude-opus-4-6"
|
|
376
|
+
},
|
|
377
|
+
"summary": {
|
|
378
|
+
"codeChanges": 4,
|
|
379
|
+
"environmentMutations": 3,
|
|
380
|
+
"eventsSent": 2,
|
|
381
|
+
"deploymentsCompleted": 2,
|
|
382
|
+
"testsRun": 2,
|
|
383
|
+
"testsPassed": 2,
|
|
384
|
+
"testsFailed": 0,
|
|
385
|
+
"irreversibleActions": 2
|
|
386
|
+
},
|
|
387
|
+
"changes": [
|
|
388
|
+
{
|
|
389
|
+
"seq": 1,
|
|
390
|
+
"timestamp": "2026-02-23T09:00:12Z",
|
|
391
|
+
"category": "CODE",
|
|
392
|
+
"action": "CREATE",
|
|
393
|
+
"target": {
|
|
394
|
+
"type": "file",
|
|
395
|
+
"path": "accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/plugins/rules/hm-extensions/src/main/java/com/fluentcommerce/hm/CancelOrderRule.java"
|
|
396
|
+
},
|
|
397
|
+
"details": "New rule class: CancelOrderRule implementing order cancellation logic",
|
|
398
|
+
"reversible": true,
|
|
399
|
+
"rollbackCommand": "rm accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/plugins/rules/hm-extensions/src/main/java/com/fluentcommerce/hm/CancelOrderRule.java",
|
|
400
|
+
"skill": "fluent-rule-scaffold",
|
|
401
|
+
"storyRef": "US-301"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"seq": 2,
|
|
405
|
+
"timestamp": "2026-02-23T09:05:33Z",
|
|
406
|
+
"category": "CODE",
|
|
407
|
+
"action": "MODIFY",
|
|
408
|
+
"target": {
|
|
409
|
+
"type": "file",
|
|
410
|
+
"path": "accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/resources/module.json"
|
|
411
|
+
},
|
|
412
|
+
"details": "Registered CancelOrderRule in provides[] array",
|
|
413
|
+
"diff": {
|
|
414
|
+
"linesAdded": 8,
|
|
415
|
+
"linesRemoved": 0
|
|
416
|
+
},
|
|
417
|
+
"reversible": true,
|
|
418
|
+
"rollbackCommand": "git checkout -- accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/resources/module.json",
|
|
419
|
+
"skill": "fluent-rule-scaffold",
|
|
420
|
+
"storyRef": "US-301"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"seq": 3,
|
|
424
|
+
"timestamp": "2026-02-23T09:12:45Z",
|
|
425
|
+
"category": "CONFIG",
|
|
426
|
+
"action": "SETTING_CREATE",
|
|
427
|
+
"target": {
|
|
428
|
+
"type": "setting",
|
|
429
|
+
"key": "WEBHOOK_CANCEL_ORDER_URL",
|
|
430
|
+
"context": "RETAILER",
|
|
431
|
+
"contextId": 5
|
|
432
|
+
},
|
|
433
|
+
"details": "Created webhook setting for order cancellation notifications",
|
|
434
|
+
"previousValue": null,
|
|
435
|
+
"newValue": "https://webhook.site/abc123-def456",
|
|
436
|
+
"reversible": true,
|
|
437
|
+
"rollbackCommand": "Delete setting WEBHOOK_CANCEL_ORDER_URL via GraphQL mutation deleteSetting",
|
|
438
|
+
"tool": "setting.upsert",
|
|
439
|
+
"skill": "fluent-settings"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"seq": 4,
|
|
443
|
+
"timestamp": "2026-02-23T09:45:18Z",
|
|
444
|
+
"category": "TEST",
|
|
445
|
+
"action": "BUILD",
|
|
446
|
+
"target": {
|
|
447
|
+
"type": "build",
|
|
448
|
+
"command": "mvn clean install -f accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/plugins/pom.xml",
|
|
449
|
+
"exitCode": 0,
|
|
450
|
+
"testCount": 42,
|
|
451
|
+
"failureCount": 0
|
|
452
|
+
},
|
|
453
|
+
"details": "Maven build: 42 tests passed, 0 failures",
|
|
454
|
+
"result": "PASS",
|
|
455
|
+
"skill": "fluent-build"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"seq": 5,
|
|
459
|
+
"timestamp": "2026-02-23T10:02:07Z",
|
|
460
|
+
"category": "ENVIRONMENT",
|
|
461
|
+
"action": "DEPLOY",
|
|
462
|
+
"target": {
|
|
463
|
+
"type": "module",
|
|
464
|
+
"name": "fc-module-hm-extensions",
|
|
465
|
+
"version": "1.3.0",
|
|
466
|
+
"retailer": "HM_TEST"
|
|
467
|
+
},
|
|
468
|
+
"details": "Module deployed via fluent module install",
|
|
469
|
+
"previousVersion": "1.2.3",
|
|
470
|
+
"reversible": true,
|
|
471
|
+
"rollbackCommand": "fluent module install -p HMDEV -r HM_TEST -m fc-module-hm-extensions:1.2.3",
|
|
472
|
+
"skill": "fluent-module-deploy"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"seq": 6,
|
|
476
|
+
"timestamp": "2026-02-23T10:08:34Z",
|
|
477
|
+
"category": "ENVIRONMENT",
|
|
478
|
+
"action": "DEPLOY",
|
|
479
|
+
"target": {
|
|
480
|
+
"type": "workflow",
|
|
481
|
+
"name": "ORDER::HD",
|
|
482
|
+
"version": 14,
|
|
483
|
+
"retailer": "HM_TEST"
|
|
484
|
+
},
|
|
485
|
+
"details": "Workflow uploaded with new CancelOrder ruleset added",
|
|
486
|
+
"previousVersion": 13,
|
|
487
|
+
"reversible": true,
|
|
488
|
+
"rollbackCommand": "Re-upload ORDER::HD version 13 JSON via workflow.upload",
|
|
489
|
+
"tool": "workflow.upload",
|
|
490
|
+
"skill": "fluent-workflow-builder"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"seq": 7,
|
|
494
|
+
"timestamp": "2026-02-23T10:15:50Z",
|
|
495
|
+
"category": "ENVIRONMENT",
|
|
496
|
+
"action": "EVENT",
|
|
497
|
+
"target": {
|
|
498
|
+
"type": "event",
|
|
499
|
+
"eventName": "CreateOrder",
|
|
500
|
+
"entityType": "ORDER",
|
|
501
|
+
"entityRef": "HD_TEST_20260223_001",
|
|
502
|
+
"mode": "async"
|
|
503
|
+
},
|
|
504
|
+
"details": "E2E test: created test order via CreateOrder event",
|
|
505
|
+
"outcome": "SUCCESS",
|
|
506
|
+
"reversible": false,
|
|
507
|
+
"tool": "event.send",
|
|
508
|
+
"skill": "fluent-e2e-test"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"seq": 8,
|
|
512
|
+
"timestamp": "2026-02-23T10:16:22Z",
|
|
513
|
+
"category": "TEST",
|
|
514
|
+
"action": "ASSERT",
|
|
515
|
+
"target": {
|
|
516
|
+
"type": "assertion",
|
|
517
|
+
"entityType": "ORDER",
|
|
518
|
+
"entityRef": "HD_TEST_20260223_001",
|
|
519
|
+
"expectedStatus": "BOOKED",
|
|
520
|
+
"actualStatus": "BOOKED"
|
|
521
|
+
},
|
|
522
|
+
"details": "Assert order status=BOOKED after ConfirmValidation cascade",
|
|
523
|
+
"result": "PASS",
|
|
524
|
+
"tool": "test.assert",
|
|
525
|
+
"skill": "fluent-e2e-test"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"seq": 9,
|
|
529
|
+
"timestamp": "2026-02-23T10:22:11Z",
|
|
530
|
+
"category": "ENVIRONMENT",
|
|
531
|
+
"action": "EVENT",
|
|
532
|
+
"target": {
|
|
533
|
+
"type": "event",
|
|
534
|
+
"eventName": "CancelOrder",
|
|
535
|
+
"entityType": "ORDER",
|
|
536
|
+
"entityRef": "HD_TEST_20260223_001",
|
|
537
|
+
"mode": "async"
|
|
538
|
+
},
|
|
539
|
+
"details": "E2E test: cancelled test order via CancelOrder event",
|
|
540
|
+
"outcome": "SUCCESS",
|
|
541
|
+
"reversible": false,
|
|
542
|
+
"tool": "event.send",
|
|
543
|
+
"skill": "fluent-e2e-test"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"seq": 10,
|
|
547
|
+
"timestamp": "2026-02-23T10:22:45Z",
|
|
548
|
+
"category": "ENVIRONMENT",
|
|
549
|
+
"action": "MUTATION",
|
|
550
|
+
"target": {
|
|
551
|
+
"type": "entity",
|
|
552
|
+
"entityType": "ORDER",
|
|
553
|
+
"entityRef": "HD_TEST_20260223_001",
|
|
554
|
+
"entityId": "48291",
|
|
555
|
+
"fields": ["status"]
|
|
556
|
+
},
|
|
557
|
+
"details": "Order status confirmed CANCELLED via workflow processing",
|
|
558
|
+
"previousValue": "BOOKED",
|
|
559
|
+
"newValue": "CANCELLED",
|
|
560
|
+
"outcome": "SUCCESS",
|
|
561
|
+
"reversible": false,
|
|
562
|
+
"tool": "graphql.query",
|
|
563
|
+
"skill": "fluent-e2e-test"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"seq": 11,
|
|
567
|
+
"timestamp": "2026-02-23T11:40:30Z",
|
|
568
|
+
"category": "CODE",
|
|
569
|
+
"action": "COMMIT",
|
|
570
|
+
"target": {
|
|
571
|
+
"type": "git",
|
|
572
|
+
"repo": "fluentcommerce-fc-module-hm-extensions",
|
|
573
|
+
"branch": "feature/cancel-order",
|
|
574
|
+
"hash": "a1b2c3d"
|
|
575
|
+
},
|
|
576
|
+
"details": "feat: add cancel order rule and workflow support",
|
|
577
|
+
"reversible": true,
|
|
578
|
+
"rollbackCommand": "git revert a1b2c3d"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"seq": 12,
|
|
582
|
+
"timestamp": "2026-02-23T11:42:08Z",
|
|
583
|
+
"category": "CODE",
|
|
584
|
+
"action": "PUSH",
|
|
585
|
+
"target": {
|
|
586
|
+
"type": "git",
|
|
587
|
+
"repo": "fluentcommerce-fc-module-hm-extensions",
|
|
588
|
+
"branch": "feature/cancel-order",
|
|
589
|
+
"remote": "origin"
|
|
590
|
+
},
|
|
591
|
+
"details": "Pushed feature/cancel-order to origin",
|
|
592
|
+
"reversible": true,
|
|
593
|
+
"rollbackCommand": "git push origin feature/cancel-order --force"
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
"compliance": {
|
|
597
|
+
"scopeDocumentRef": "scope/cancel-order.md",
|
|
598
|
+
"tasksCompleted": 8,
|
|
599
|
+
"tasksTotal": 10,
|
|
600
|
+
"traceability": {
|
|
601
|
+
"US-301": {
|
|
602
|
+
"tasks": ["T-001", "T-002", "T-003", "T-004", "T-005"],
|
|
603
|
+
"status": "complete",
|
|
604
|
+
"changes": [1, 2, 3, 5, 6]
|
|
605
|
+
},
|
|
606
|
+
"US-302": {
|
|
607
|
+
"tasks": ["T-006", "T-007", "T-008"],
|
|
608
|
+
"status": "complete",
|
|
609
|
+
"changes": [7, 8, 9, 10]
|
|
610
|
+
},
|
|
611
|
+
"US-303": {
|
|
612
|
+
"tasks": ["T-009", "T-010"],
|
|
613
|
+
"status": "not_started",
|
|
614
|
+
"changes": []
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
"preDeployChecklist": "accounts/HMDEV/analysis/pre-deploy/fc-module-hm-extensions-1.3.0.checklist.json",
|
|
618
|
+
"irreversibleActions": [
|
|
619
|
+
{
|
|
620
|
+
"seq": 7,
|
|
621
|
+
"description": "Event CreateOrder sent to ORDER/HD_TEST_20260223_001 -- cannot be un-sent",
|
|
622
|
+
"risk": "LOW"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"seq": 9,
|
|
626
|
+
"description": "Event CancelOrder sent to ORDER/HD_TEST_20260223_001 -- cannot be un-sent",
|
|
627
|
+
"risk": "LOW"
|
|
628
|
+
}
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
```
|