paput-mcp 4.2.6 → 4.2.9

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/README.md CHANGED
@@ -121,7 +121,7 @@ npx -y paput-mcp setup-ai --codex-only
121
121
 
122
122
  Generated skills:
123
123
 
124
- - `paput-init` - Initialize PaPut usage and inspect unprocessed sessions from local-file-capable AI clients.
124
+ - `paput-harvest` - Harvest reusable knowledge from past local sessions in local-file-capable AI clients. Safe to run repeatedly; skips already-processed sessions.
125
125
  - `paput-capture` - Extract reusable knowledge candidates from the current conversation or a specified topic and add them to pending.
126
126
  - `paput-save` - Review pending candidates first, then save only candidates explicitly approved by the user.
127
127
  - `paput-analyze-discard-policy` - Analyze discarded candidates and save a capture policy used by future captures.
@@ -268,7 +268,8 @@ Remote HTTP MCP.
268
268
 
269
269
  PaPut MCP no longer reads local Claude/Codex session files as MCP tools. When
270
270
  using Claude Code, Codex, or another AI client with local file access, run the
271
- installed `paput-init` skill. The AI client reads its own session files, extracts
271
+ installed `paput-harvest` skill (safe to run repeatedly; it skips
272
+ already-processed sessions). The AI client reads its own session files, extracts
272
273
  reusable knowledge, and submits only the resulting candidates and processed
273
274
  session markers through PaPut MCP.
274
275
 
@@ -53,8 +53,24 @@ Guidance:
53
53
 
54
54
  - Capture candidates are reusable decision criteria, procedures, or principles, so prefer `decision` / `operation` / `principle` when they fit; use `knowledge` for commodity technical know-how.
55
55
  - `decision` / `operation` / `principle` are the primary material for the public AI summary; `knowledge` usually is not.
56
+ - Tagging review — do not under-label. The default failure mode is dropping a judgment memo into `knowledge` and missing `decision` / `operation` / `principle`; this is a main reason the `principle` axis stays thin. Consider the durable three FIRST and use `knowledge` only when none genuinely fit. Quick catches: a stated reason for choosing or avoiding an option → `decision`; an operating practice (how you measure, review, run, or verify) → `operation`; a generalized stance one level above a single decision → `principle`. Before finalizing `memo_type_keys`, re-read the candidate once and ask "is there a judgment here that I labeled as mere knowledge?". Do not over-correct either: `principle` needs an explicitly generalized stance, not a one-off opinion — keep it honest against the Quality Bar.
57
+ - AI-collaboration practices and stances belong here, not in the reject pile: how you structure a task or spec for an AI, your review discipline for AI-generated changes, where you verify versus trust AI output, when you delegate versus do it yourself. Capture the reusable practice as `operation` or the stated stance as `principle` — generalized so it would hold with a different AI tool, on a different project, for someone else to learn. This is the scarcest, most durable axis; do not drop it as workflow chatter.
56
58
  - Leaving a candidate unclassified (no type) is allowed, but classifying it improves analysis and the public profile. Do not force a type when none fits.
57
59
 
60
+ ## Eliciting scarce operating practices (eval / observability)
61
+
62
+ `operation` is a primary public-summary axis, but its eval / observability / measurement part is the scarcest and most easily lost — it surfaces as "how the work was measured and watched", not as a deliverable, so generic free-form capture tends to miss it or leave thin, ad-hoc candidates. When the conversation touched measurement, evaluation, monitoring, alerting, test strategy, SLO / SLI, threshold or pass-fail tuning, or incident review, do not let it pass as a work log: actively draw out the reusable practice and capture it as `operation` (or `principle` for a stated stance, `decision` for an adopt/reject criterion).
63
+
64
+ Draw out only what fits the conversation — do not interrogate:
65
+
66
+ - What was measured, and why that signal rather than another?
67
+ - How was signal separated from noise?
68
+ - How was the threshold / pass-fail decided — by feel, or by offline evaluation?
69
+ - What is watched in production, and where were alerts placed, and why there?
70
+ - What did a failure or false positive teach, and how did it change the judgment?
71
+
72
+ Generalize one level above the project: drop service, metric, and dashboard names; keep the criterion, the rationale, and the verification method. A candidate here must carry at least one of measurement target + why, threshold rationale, or verification method — a bare "added monitoring" or "wrote tests" is a work log, not knowledge. This is a lens for capturing the user's methodology, not a feature: do not turn PaPut into an eval or monitoring tool.
73
+
58
74
  ## Quality Bar
59
75
 
60
76
  Before adding a candidate, make sure the body preserves enough reasoning for future reuse. A good candidate is not just a conclusion; it should include the relevant problem context, decision criteria, applicability conditions, tradeoffs, pitfalls, operational guidance, or verification method.
@@ -73,7 +89,7 @@ Prefer generalized but concrete writing:
73
89
  Do not add these to pending:
74
90
 
75
91
  - Project-specific specifications, screen names, button names, business workflows, operational rules, or local context.
76
- - Personal workflow notes about PRs, GitHub, Codex, Claude, AI review, editors, or OS operations.
92
+ - One-off tool mechanics or configuration: editor / OS / CLI settings, keybindings, which button was clicked, model- or version-specific quirks, project-specific CI wiring, or anecdotes about a single session (for example, "the AI got confused here"). These are commodity even when they mention AI tools — capture the reusable practice or stance instead, not the mechanics. Reusable AI-collaboration practices and stances ARE worth capturing (see the AI-collaboration note under Memo Type); do not discard them as workflow chatter.
77
93
  - Content that third parties cannot understand from the title and body alone.
78
94
  - Rejected designs, anecdotes, work logs, impressions, or decision histories without reusable guidance.
79
95
  - Content semantically close to existing memos or pending candidates.
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: paput-harvest
3
+ description: Use this to harvest reusable knowledge from past local Claude/Codex sessions when the AI client can read local files. Safe to run repeatedly — it skips already-processed sessions and only reviews new ones — so use it both for first-time onboarding and for periodic catch-up. Pay special attention to AI-collaboration practices and stances (operation / principle), the scarce, durable axis.
4
+ ---
5
+
6
+ # PaPut Harvest
7
+
8
+ Harvest reusable knowledge from past local AI sessions into pending candidates.
9
+
10
+ This skill is for local-file-capable AI clients such as Claude Code or Codex.
11
+ PaPut MCP does not read local session files. The AI client reads the session
12
+ files directly, then uses PaPut MCP only to check processed-session markers and
13
+ add or mark reviewed sessions.
14
+
15
+ Run it whenever you want — it is idempotent. It checks which sessions are already
16
+ processed and reviews only the new ones, so the first run doubles as onboarding
17
+ (nothing is processed yet, so it surveys your history) and later runs are
18
+ periodic catch-up. There is no separate "init" step.
19
+
20
+ ## Steps
21
+
22
+ 1. Get processed sessions with `paput_list_processed_sessions`.
23
+ 2. Find local session files the AI client can access:
24
+ - Claude: `~/.claude/projects/**/*.jsonl`
25
+ - Codex: `~/.codex/sessions/**/*.jsonl`
26
+ 3. For each file, derive:
27
+ - `source`: `claude` or `codex`
28
+ - `session_id`: file basename without `.jsonl`
29
+ - `source_session_updated_at`: file modified time in ISO 8601 format
30
+ 4. Skip sessions already returned by `paput_list_processed_sessions`.
31
+ 5. Report the count and a short summary of unprocessed sessions to the user.
32
+ 6. Only when the user wants it, read the relevant session transcript directly
33
+ from the JSONL file and create candidates that meet the extraction criteria.
34
+ While reading, actively look for the AI-collaboration axis (see Extraction
35
+ Criteria) in addition to ordinary technical knowledge — it is easy to miss
36
+ because it shows up as how the work was directed, not as the work itself.
37
+ 7. Before adding candidates with `paput_add_knowledge_candidates`, check that
38
+ they do not contain project-specific specifications, implementation details,
39
+ operational rules, code, customer data, or secrets. Duplicate checks against
40
+ existing memos run automatically inside `paput_add_knowledge_candidates`
41
+ using semantic search.
42
+ 8. If reusable candidates exist, call `paput_add_knowledge_candidates` with
43
+ `source`, `session_id`, `source_session_updated_at`, and the candidates.
44
+ Set `memo_type_keys` on each candidate (see Memo Type below); classify
45
+ AI-collaboration practices as `operation` and stances as `principle`.
46
+ 9. If the session was reviewed but no candidates should be added, call
47
+ `paput_mark_processed_session` with `source`, `session_id`, and
48
+ `source_session_updated_at`.
49
+ 10. Briefly report added candidates, duplicates, rejected candidates, and
50
+ sessions marked as processed.
51
+
52
+ ## JSONL Parsing Guide
53
+
54
+ When reading session files, extract user and assistant messages only.
55
+
56
+ Claude session lines commonly have:
57
+
58
+ - `type`: `user` or `assistant`
59
+ - `message.role`: `user` or `assistant`
60
+ - `message.content`: string or content blocks such as `{ "type": "text", "text": "..." }`
61
+ - `cwd`, `message.cwd`, or `payload.cwd` may exist as local context, but do not
62
+ save local paths or project-specific details as knowledge.
63
+
64
+ Codex session lines commonly have:
65
+
66
+ - `type`: `response_item`
67
+ - `payload.type`: `message`
68
+ - `payload.role`: `user` or `assistant`
69
+ - `payload.content`: content blocks such as `input_text`, `output_text`, or `text`
70
+ - `payload.cwd` may exist as local context, but do not save local paths or
71
+ project-specific details as knowledge.
72
+
73
+ Read only what is needed. If the session is large, inspect metadata and relevant
74
+ tail sections first, then ask before reading more.
75
+
76
+ ## Extraction Criteria
77
+
78
+ Only add technical knowledge, decision criteria, and procedures that can be reused in other projects.
79
+
80
+ ### Capture the AI-collaboration axis
81
+
82
+ Reusable AI-collaboration practices and stances are first-class material here —
83
+ they are the scarcest, most durable axis and are easy to discard by mistake.
84
+ Capture them as `operation` (practice) or `principle` (stance). Examples:
85
+
86
+ - How you structure a task or spec so an AI implements it correctly.
87
+ - Your review discipline for AI-generated changes — where you always verify
88
+ versus where you trust the output.
89
+ - When you delegate to an AI versus do it yourself.
90
+ - How you decompose work for parallel agents, or recover when an AI goes wrong.
91
+
92
+ The test: would this still hold with a different AI tool, on a different
93
+ project, for someone else to learn? If yes, capture it as `operation` or
94
+ `principle`, generalized one level above the specific session. If it is only
95
+ about this tool's mechanics or this one session's events, exclude it.
96
+
97
+ ### Capture the eval / observability axis
98
+
99
+ Eval, observability, and measurement practices are another scarce, durable
100
+ `operation` sub-axis that is easy to lose — they show up as how the work was
101
+ measured and watched, not as the work itself. When a session touched
102
+ measurement, evaluation, monitoring, alerting, test strategy, SLO / SLI,
103
+ threshold or pass-fail tuning, or incident review, capture the reusable practice
104
+ as `operation` (or `principle` for a stance, `decision` for an adopt/reject
105
+ criterion). Look for:
106
+
107
+ - What was measured and why that signal; how signal was separated from noise.
108
+ - How a threshold or pass-fail was decided — by feel or by offline evaluation.
109
+ - What is watched in production and where alerts sit, and why there.
110
+ - What a failure or false positive changed in the judgment.
111
+
112
+ Generalize above the project (drop service / metric / dashboard names, keep the
113
+ criterion and verification). A bare "added monitoring" or "wrote tests" with no
114
+ rationale or verification is a work log — exclude it. This is a lens for
115
+ capturing methodology, not a reason to log routine test/monitoring chores.
116
+
117
+ ### Do not add these to pending
118
+
119
+ - Project-specific specifications, screen names, button names, business workflows, operational rules, or local context.
120
+ - One-off tool mechanics or configuration: editor / OS / CLI settings, keybindings, which button was clicked, model- or version-specific quirks, project-specific CI wiring, or anecdotes about a single session (for example, "the AI got confused here"). These are commodity even when they mention AI tools — capture the reusable practice or stance instead, not the mechanics.
121
+ - Content that third parties cannot understand from the title and body alone.
122
+ - Rejected designs, anecdotes, work logs, impressions, or decision histories without reusable guidance.
123
+ - Content semantically close to existing memos or pending candidates.
124
+ - Generic security, authorization, or tenant-isolation notes when similar knowledge already exists.
125
+ - Code fragments or project-specific naming that has not been generalized.
126
+
127
+ When unsure, do not add the candidate. Report that there is no knowledge to save or that the candidate was rejected.
128
+
129
+ ## Memo Type
130
+
131
+ Classify each candidate with one or more memo types via `memo_type_keys`:
132
+
133
+ - `decision`: reusable judgment criteria independent of any project.
134
+ - `operation`: operating practices — observability, eval, testing, review, and how you direct and verify AI collaboration.
135
+ - `principle`: a stance you have explicitly stated, generalized above individual decisions, including stances on how to work with AI.
136
+ - `knowledge`: commodity technical know-how, usage, or implementation knowledge.
137
+
138
+ `decision` / `operation` / `principle` are the primary material for the public
139
+ AI summary and the principle synthesizer; `knowledge` usually is not. Prefer the
140
+ durable types when they fit, and do not force a type when none does.
141
+
142
+ Tagging review — do not under-label. The default failure mode is dropping a
143
+ judgment memo into `knowledge` and missing `decision` / `operation` /
144
+ `principle`; this is a main reason the `principle` axis stays thin. Consider the
145
+ durable three FIRST and use `knowledge` only when none genuinely fit. Quick
146
+ catches: a stated reason for choosing or avoiding an option → `decision`; an
147
+ operating practice (how you measure, review, run, or verify) → `operation`; a
148
+ generalized stance one level above a single decision → `principle`. Before
149
+ finalizing `memo_type_keys`, re-read the candidate once and ask whether there is
150
+ a judgment you labeled as mere knowledge. Do not over-correct: `principle` needs
151
+ an explicitly generalized stance, not a one-off opinion.
152
+
153
+ ## Notes
154
+
155
+ - Do not save directly to PaPut.
156
+ - Add candidates to the API-backed pending queue first.
157
+ - `paput_add_knowledge_candidates` marks the source session as processed when candidates are submitted.
158
+ - Use `paput_mark_processed_session` after reviewing a session that produces no candidates.
159
+ - Report duplicates or similar memos when found.
160
+ - Prefer high-quality pending candidates over increasing the pending count.
@@ -39,7 +39,7 @@ Remote MCP connections use OAuth. PaPut issues tokens after you sign in and appr
39
39
  Pending candidates, discarded candidate metadata, processed AI session markers,
40
40
  and capture policies are stored in PaPut API storage, not under `~/.paput`.
41
41
  PaPut MCP does not read local Claude/Codex session files. When you use
42
- `paput-init` in a local-file-capable client such as Claude Code or Codex, that
42
+ `paput-harvest` in a local-file-capable client such as Claude Code or Codex, that
43
43
  client may read its own session files and submit only extracted candidates or
44
44
  processed-session markers to PaPut MCP.
45
45
 
package/docs/tools.md CHANGED
@@ -5,8 +5,8 @@ PaPut MCP is a data-only MCP server. It exposes tools and resources for PaPut da
5
5
  Remote HTTP mode exposes API-backed PaPut tools. Pending candidates, processed
6
6
  session markers, and capture policies are stored by the PaPut API. PaPut MCP
7
7
  does not expose tools that read local Claude/Codex session files; local-file-
8
- capable clients can read those files themselves through the `paput-init` skill
9
- workflow and then submit extracted candidates through MCP.
8
+ capable clients can read those files themselves through the `paput-harvest`
9
+ skill workflow and then submit extracted candidates through MCP.
10
10
 
11
11
  ## Confirmation Policy
12
12
 
@@ -184,5 +184,5 @@ The capture policy is not saved as a PaPut memo. It is stored by the PaPut API
184
184
  and is available through Remote HTTP MCP.
185
185
 
186
186
  For past-session import, a local-file-capable AI client should read its own
187
- Claude/Codex session files through the `paput-init` skill, then call
187
+ Claude/Codex session files through the `paput-harvest` skill, then call
188
188
  `paput_add_knowledge_candidates` or `paput_mark_processed_session`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paput-mcp",
3
- "version": "4.2.6",
3
+ "version": "4.2.9",
4
4
  "description": "PaPut MCP Server",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,89 +0,0 @@
1
- ---
2
- name: paput-init
3
- description: Use this to initialize PaPut usage and inspect unprocessed local Claude/Codex sessions when the AI client can read local files.
4
- ---
5
-
6
- # PaPut Init
7
-
8
- Initialize PaPut knowledge capture from past local AI sessions.
9
-
10
- This skill is for local-file-capable AI clients such as Claude Code or Codex.
11
- PaPut MCP does not read local session files. The AI client should read the
12
- session files directly, then use PaPut MCP only to check processed-session
13
- markers and add or mark reviewed sessions.
14
-
15
- ## Steps
16
-
17
- 1. Get processed sessions with `paput_list_processed_sessions`.
18
- 2. Find local session files the AI client can access:
19
- - Claude: `~/.claude/projects/**/*.jsonl`
20
- - Codex: `~/.codex/sessions/**/*.jsonl`
21
- 3. For each file, derive:
22
- - `source`: `claude` or `codex`
23
- - `session_id`: file basename without `.jsonl`
24
- - `source_session_updated_at`: file modified time in ISO 8601 format
25
- 4. Skip sessions already returned by `paput_list_processed_sessions`.
26
- 5. Report the count and a short summary of unprocessed sessions to the user.
27
- 6. Only when the user wants it, read the relevant session transcript directly
28
- from the JSONL file and create candidates that meet the extraction criteria.
29
- 7. Before adding candidates with `paput_add_knowledge_candidates`, check that
30
- they do not contain project-specific specifications, implementation details,
31
- operational rules, code, customer data, or secrets. Duplicate checks against
32
- existing memos run automatically inside `paput_add_knowledge_candidates`
33
- using semantic search.
34
- 8. If reusable candidates exist, call `paput_add_knowledge_candidates` with
35
- `source`, `session_id`, `source_session_updated_at`, and the candidates.
36
- 9. If the session was reviewed but no candidates should be added, call
37
- `paput_mark_processed_session` with `source`, `session_id`, and
38
- `source_session_updated_at`.
39
- 10. Briefly report added candidates, duplicates, rejected candidates, and
40
- sessions marked as processed.
41
-
42
- ## JSONL Parsing Guide
43
-
44
- When reading session files, extract user and assistant messages only.
45
-
46
- Claude session lines commonly have:
47
-
48
- - `type`: `user` or `assistant`
49
- - `message.role`: `user` or `assistant`
50
- - `message.content`: string or content blocks such as `{ "type": "text", "text": "..." }`
51
- - `cwd`, `message.cwd`, or `payload.cwd` may exist as local context, but do not
52
- save local paths or project-specific details as knowledge.
53
-
54
- Codex session lines commonly have:
55
-
56
- - `type`: `response_item`
57
- - `payload.type`: `message`
58
- - `payload.role`: `user` or `assistant`
59
- - `payload.content`: content blocks such as `input_text`, `output_text`, or `text`
60
- - `payload.cwd` may exist as local context, but do not save local paths or
61
- project-specific details as knowledge.
62
-
63
- Read only what is needed. If the session is large, inspect metadata and relevant
64
- tail sections first, then ask before reading more.
65
-
66
- ## Extraction Criteria
67
-
68
- Only add technical knowledge, decision criteria, and procedures that can be reused in other projects.
69
-
70
- Do not add these to pending:
71
-
72
- - Project-specific specifications, screen names, button names, business workflows, operational rules, or local context.
73
- - Personal workflow notes about PRs, GitHub, Codex, Claude, AI review, editors, or OS operations.
74
- - Content that third parties cannot understand from the title and body alone.
75
- - Rejected designs, anecdotes, work logs, impressions, or decision histories without reusable guidance.
76
- - Content semantically close to existing memos or pending candidates.
77
- - Generic security, authorization, or tenant-isolation notes when similar knowledge already exists.
78
- - Code fragments or project-specific naming that has not been generalized.
79
-
80
- When unsure, do not add the candidate. Report that there is no knowledge to save or that the candidate was rejected.
81
-
82
- ## Notes
83
-
84
- - Do not save directly to PaPut.
85
- - Add candidates to the API-backed pending queue first.
86
- - `paput_add_knowledge_candidates` marks the source session as processed when candidates are submitted.
87
- - Use `paput_mark_processed_session` after reviewing a session that produces no candidates.
88
- - Report duplicates or similar memos when found.
89
- - Prefer high-quality pending candidates over increasing the pending count.