@codacy/verity-cli 0.32.6-experimental.df0a578 → 0.32.7

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.
@@ -1,22 +1,20 @@
1
1
  ---
2
2
  description: >-
3
3
  Capture a durable learning at the end of a task: draft a concrete, cited observation from
4
- what actually happened and record it straight into the project knowledge base. Use at natural
4
+ what actually happened, then confirm it with the user or record it directly. Use at natural
5
5
  task-completion moments, or when the user asks to record a lesson.
6
6
  ---
7
7
  # /verity-reflect — Capture learnings after a task
8
8
 
9
- At a natural task-completion moment, **the agent reflects and records** — draft a
10
- concrete, cited observation from what actually happened, write it to the project
11
- knowledge base, and say what you wrote. No question, no waiting.
9
+ At a natural task-completion moment, **the agent reflects first** — draft a
10
+ concrete, cited observation from what actually happened then either confirm it
11
+ with the user (interactive) or record it directly (autonomous). This is the
12
+ "reflection flip": Verity stops asking the user to do the reflecting and instead
13
+ does the work, with the human as editor rather than author.
12
14
 
13
- This is the second half of the "reflection flip". Verity first stopped asking the
14
- user to do the reflecting; it now also stops asking permission to keep it. The
15
- human is a reader and editor of the record, not a gate in front of it.
15
+ ## The flip draft first, then confirm or auto-record
16
16
 
17
- ## The flow
18
-
19
- ### 1. Draft
17
+ ### 1. Self-draft (always)
20
18
 
21
19
  When a task is complete, draft **1–3** things genuinely worth remembering — a
22
20
  **decision**, a **gotcha**, or a **pattern** — from what happened this task. Each
@@ -24,69 +22,47 @@ item must be **concrete and cited**: name the files, PR, commands, or
24
22
  error-signatures it came from. **Skip entirely if nothing non-obvious happened**
25
23
  — an empty reflection is better than a filler one.
26
24
 
27
- That last rule is now the *only* filter. Nobody is going to catch a weak
28
- reflection before it lands, so do not record one.
29
-
30
25
  Pick the right `--kind` per item: `decision`, `gotcha`, `pattern`, `security`,
31
26
  `quality`, `intent`, `domain`, `integration`.
32
27
 
33
- **Citing the files is not decoration — it is what makes the reflection findable.**
34
- Verity scopes a node to the paths named in its text, and retrieval seeds on that
35
- scope. A reflection that names no file in this repo is recorded and then never
36
- surfaces again, in any future review. So write `src/payments/retry.ts:88`, not
37
- "the retry path".
38
-
39
- ### 2. Record it
28
+ ### 2. Branch on run mode
40
29
 
41
- ```bash
42
- verity reflect --user-input "<your draft>" --kind <kind>
43
- ```
30
+ **Interactive** (a person is at the keyboard — a TTY): show your draft and ask
31
+ one question before recording:
44
32
 
45
- That is the whole step. It never blocks, never prompts, and works the same in a
46
- TTY, a hook, CI, or a cron run.
33
+ > "Here's my reflection draft for the project memory: _\<draft\>_. Anything to
34
+ > **confirm, correct, or add** before I record it? (Say 'skip' to drop it.)"
47
35
 
48
- If the reflection genuinely cannot name its files in prose, scope it explicitly:
36
+ Then record the **final** text with their corrections folded in via:
49
37
 
50
38
  ```bash
51
- verity reflect --user-input "<your draft>" --kind <kind> --file-globs "src/auth/**"
39
+ verity reflect --user-input "<final reflection>" --kind <kind>
52
40
  ```
53
41
 
54
- The command warns when a reflection resolved to no files, so you will know when
55
- this is needed rather than discovering it months later as a node nobody read.
42
+ If they say "skip", do **not** record.
56
43
 
57
- **When the *user* authored the words** they said "record this: …", or dictated
58
- a lesson in their own terms add `--confirmed`:
44
+ **Autonomous** (no person to confirmheadless / CI / cron, or
45
+ `VERITY_AUTONOMOUS=1`, or a non-TTY session): record your draft **directly**,
46
+ never blocking:
59
47
 
60
48
  ```bash
61
- verity reflect --user-input "<what they said>" --kind <kind> --confirmed
49
+ verity reflect --user-input "<your draft>" --kind <kind> --autonomous
62
50
  ```
63
51
 
64
- This is not a formality. Without the flag a reflection is stored as
65
- `source: agent` (confidence 0.7) — *Verity thought this, nobody checked it*. With
66
- it, `source: user` at confidence 1.0 — *a person stands behind this*. The
67
- dashboard, the retrieval ranking, and the next agent to read the node all rely on
68
- the difference. Never pass `--confirmed` for your own draft, even a good one.
69
-
70
- ### 3. Tell the user, in one line
71
-
72
- The command prints the node id, the local file path, and a dashboard link. Relay
73
- it — one line, no ceremony:
74
-
75
- > Recorded a gotcha about the Stripe retry path → `.verity/memory/gotchas/n104-stripe-idempotency-keys.md`
76
-
77
- They did not agree to this in advance, so they need to know it happened and where
78
- to go if it is wrong. Do not ask them to confirm it after the fact either — the
79
- file is right there, and editing or deleting it is the correction.
52
+ Mode is auto-detected when you omit the flag (TTY interactive, non-TTY
53
+ autonomous); pass `--autonomous` to be explicit, or set `VERITY_AUTONOMOUS=0` to
54
+ force a confirm step even in a headless run.
80
55
 
81
- ### 4. Where it lands
56
+ ### 3. Where it lands
82
57
 
83
- Only Verity's own memory namespace — `.verity/memory/` (mirrored to the service).
84
- Verity never writes a repo's own `agents/memory` or any other store. One node per
85
- item, synced to disk immediately so it is readable and editable straight away.
58
+ The reflection is recorded **only to Verity's own memory namespace**
59
+ `.verity/memory/` (synced to the service). Verity never writes a repo's own
60
+ `agents/memory` or any other store. One node per item; `source: 'user'`,
61
+ `confidence: 1.0`, never auto-archived.
86
62
 
87
63
  ## Auto-reflection (extract from task history)
88
64
 
89
- Complementary to the above: trigger the server-side LLM extractor to mine the
65
+ Complementary to the flip: trigger the server-side LLM extractor to mine the
90
66
  current task's run history and produce 0–3 nodes. This is the same extraction
91
67
  that runs automatically on task close and every 5 runs — use it to trigger
92
68
  mid-task:
@@ -95,8 +71,8 @@ mid-task:
95
71
  verity reflect
96
72
  ```
97
73
 
98
- Use the draft flow above for the **compound moment** (a specific insight worth a
99
- node); use auto-extract to harvest what the run history shows.
74
+ Use the self-draft flow above for the **compound moment** (a specific insight
75
+ worth a confirmed node); use auto-extract to harvest what the run history shows.
100
76
 
101
77
  ## When to reflect
102
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/verity-cli",
3
- "version": "0.32.6-experimental.df0a578",
3
+ "version": "0.32.7",
4
4
  "description": "CLI for Verity quality gate service",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://verity.md",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "scripts": {
25
25
  "build": "node scripts/build.js",
26
- "test": "npm run build && VERITY_TEST_PREBUILT=1 node --import tsx --test $(find tests -name '*.test.ts' -not -path 'tests/e2e/*' | sort)",
26
+ "test": "npm run build && node scripts/run-tests.mjs",
27
27
  "test:e2e": "node --import tsx --test --test-concurrency=1 tests/e2e/*.test.ts",
28
28
  "typecheck": "tsc --noEmit",
29
29
  "prepublishOnly": "npm run typecheck && npm run build"