@raquezha/notrace 0.0.3 → 0.0.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @raquezha/notrace
2
2
 
3
+ ## 0.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 6eac69d: Relocate core configuration files (`mindsets.json`, `settings.json`, `AGENTS.md`) to a dedicated `config/` directory for better maintainability and a cleaner repository root. Updated `bootstrap.sh` and shell integration to support the new layout.
8
+ - c19a93a: Add a machine-readable `notrace.json` run record alongside the existing HTML report to normalize captured session/task metadata, activity metrics, and evidence for future retrospective and comparison workflows.
9
+
10
+ ## 0.0.4
11
+
12
+ ### Patch Changes
13
+
14
+ - f2959b5: Harden notrace reports with default redaction, metadata-only capture support, offline CSP-protected HTML, escaped rendering, private file permissions, and `.workflow`-confined report writes.
15
+
3
16
  ## 0.0.3
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -1,22 +1,36 @@
1
1
  # notrace
2
2
 
3
- Phase 0 / POC local-first interactive HTML Trace Viewer for the Pi Coding Agent. It captures execution traces for workflow debugging — LLM calls, tool executions, token usage, costs — and writes an interactive HTML report to your active task workspace at session end.
3
+ Phase 0 / POC local-first trace capture for the Pi Coding Agent. It captures execution traces for workflow debugging — LLM calls, tool executions, token usage, costs — and writes both an interactive HTML report and a machine-readable `notrace.json` run record to your active task workspace at session end.
4
4
 
5
- > **POC warning:** notrace is currently for local experimentation and RPIV observability research. It can capture prompts, tool payloads, outputs, local paths, and accidental secrets. Do not publish generated reports. Redaction, safer rendering, and configurable capture levels are planned follow-up work.
5
+ > **Security warning:** notrace is local-first and now redacts common secrets by default, escapes report rendering, blocks network access in generated reports, and writes private report files. Reports can still contain sensitive prompts, tool payloads, outputs, and local paths. Do not publish generated reports.
6
+
7
+ ## Boundary with RPIV
8
+
9
+ The relationship is intentionally optional both ways:
10
+
11
+ - **notrace without RPIV**: should work; notrace-owned artifacts belong under `.notrace/`
12
+ - **RPIV without notrace**: should work; `WORK.md` remains the source of truth without any notrace dependency
13
+ - **together**: RPIV `WORK.md [LOG]` may reference notrace artifacts, but `.workflow/` should not own them
14
+
15
+ Neither package should require the other to function.
6
16
 
7
17
  ## Features
8
18
 
9
19
  - **Session timeline**: Every turn, tool call, and LLM completion rendered as an expandable card
10
20
  - **Metrics dashboard**: Total tokens, input/output split, cache reads, cost (USD), duration
11
- - **Clickable `file://` link**: Report path printed to console at session end for instant browser access
12
- - **Active task aware**: Writes the report into `.workflow/tasks/<task>/notrace.html` when a task is active
13
- - **HTML report**: Intended to become fully self-contained/offline; Phase 0 still needs hardening
21
+ - **Machine-readable run record**: Normalized `notrace.json` sidecar for future retrospective/compare flows
22
+ - **Clickable `file://` links**: Artifact paths printed to console at session end for instant browser access
23
+ - **Workdir aware**: notrace-owned artifacts are planned to live under `.notrace/` for the root execution directory
24
+ - **RPIV attachment**: When a task has a `WORK.md`, notrace appends artifact/review references into `[LOG]`
25
+ - **HTML report**: Self-contained/offline report with a restrictive CSP and no remote font/network loads
26
+ - **Safer defaults**: Secret-key/value redaction, bounded payload sizes, metadata-only mode, private file permissions, and `.workflow`-confined artifact writes
14
27
 
15
28
  ## Output
16
29
 
17
30
  ```
18
- 🔍 [notrace] Observability report generated:
19
- 📂 file:///path/to/.workflow/tasks/my-task/notrace.html
31
+ 🔍 [notrace] Observability artifacts generated:
32
+ 📂 file:///path/to/.notrace/sessions/<session-id>/notrace.html
33
+ 📂 file:///path/to/.notrace/sessions/<session-id>/notrace.json
20
34
  ```
21
35
 
22
36
  ## Usage
@@ -35,6 +49,55 @@ pi --dev
35
49
  npm install -g @raquezha/notrace
36
50
  ```
37
51
 
52
+ ## Add a human review
53
+
54
+ ```bash
55
+ npm run review:notrace -- path/to/notrace.json \
56
+ --outcome partial \
57
+ --friction high \
58
+ --lesson "Headroom reduced tokens but needed manual steering." \
59
+ --next-change "Try same task with RepoScry enabled."
60
+ ```
61
+
62
+ This writes an adjacent review sidecar. For normal runs that means `notrace.review.json` next to `notrace.json`.
63
+
64
+ If the run is attached to an RPIV task folder with `WORK.md`, the review is also logged into that task's `[LOG]` section as a reference to the notrace artifact.
65
+
66
+ Review fields:
67
+
68
+ - `outcome`: `success`, `partial`, `failed`, `abandoned`, `inconclusive`
69
+ - `friction`: `low`, `medium`, `high`
70
+ - `lesson`: short human conclusion
71
+ - `nextChange`: what to try next run
72
+
73
+ ## Compare two runs
74
+
75
+ ```bash
76
+ npm run compare:notrace -- \
77
+ path/to/baseline/notrace.json \
78
+ path/to/candidate/notrace.json
79
+ ```
80
+
81
+ This prints a small retrospective diff for:
82
+
83
+ - total/input/output tokens
84
+ - duration
85
+ - LLM calls
86
+ - tool calls
87
+ - tool errors
88
+ - total cost
89
+ - model/provider mix
90
+ - review sidecar outcome/friction/lesson when present
91
+
92
+ ## Capture controls
93
+
94
+ By default, notrace uses `NOTRACE_CAPTURE=redacted`: it captures useful payloads but redacts common secret keys/values and truncates very large values.
95
+
96
+ ```bash
97
+ NOTRACE_CAPTURE=metadata pi --dev # no prompt/tool payload bodies
98
+ NOTRACE_CAPTURE=full pi --dev # unsafe: raw payloads for local debugging only
99
+ ```
100
+
38
101
  ## Build
39
102
 
40
103
  ```bash