✨ feat: add pull-from-paper skill - #5
Conversation
Org-wide session lookup through paperctl: search, list, get, export, plus a deterministic recipe for resolving a teammate to their WorkOS auth_subject via the cwd home path in session JSON. Baseline-tested against a teammate cost question; the recipe fixed silent-zero-row email guesses and content-based misattribution.
| paperctl sessions list --limit 200 --json \ | ||
| | jq -r '.items[] | [.auth_subject, .cwd] | @tsv' \ | ||
| | awk -F'\t' '{split($2,p,"/"); print $1"\t"p[3]}' | sort -u | ||
| ``` |
There was a problem hiding this comment.
Non-home paths become usernames
When a session uses a non-home cwd such as /tmp/session-123, /workspace/project, or /root/project, this pipeline unconditionally presents the third path component as a username and discards the original path, preventing the later ambiguity check from identifying it and causing sessions to be attributed to the wrong teammate.
Prompt To Fix With AI
This is a comment left during a code review.
Path: skills/pull-from-paper/SKILL.md
Line: 43
Comment:
**Non-home paths become usernames**
When a session uses a non-home cwd such as `/tmp/session-123`, `/workspace/project`, or `/root/project`, this pipeline unconditionally presents the third path component as a username and discards the original path, preventing the later ambiguity check from identifying it and causing sessions to be attributed to the wrong teammate.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|
| Filename | Overview |
|---|---|
| skills/pull-from-paper/SKILL.md | Adds the complete paperctl workflow, but its cwd-based identity pipeline can present arbitrary path components as usernames. |
| README.md | Adds a valid catalog entry linking to the new skill. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Run paperctl status] --> B{Healthy?}
B -- No --> C[Resolve login or daemon issue]
C --> A
B -- Yes --> D{Question names a person?}
D -- Yes --> E[Resolve auth_subject]
D -- No --> F{Content-based question?}
E --> G[List scoped sessions]
F -- Yes --> H[Semantic search]
F -- No --> G
G --> I[Get session summary]
H --> I
I --> J{Transcript needed?}
J -- Yes --> K[Export scoped session]
J -- No --> L[Answer with session details]
K --> L
Prompt To Fix All With AI
### Issue 1
skills/pull-from-paper/SKILL.md:43
**Non-home paths become usernames**
When a session uses a non-home cwd such as `/tmp/session-123`, `/workspace/project`, or `/root/project`, this pipeline unconditionally presents the third path component as a username and discards the original path, preventing the later ambiguity check from identifying it and causing sessions to be attributed to the wrong teammate.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "✨ feat: add pull-from-paper skill" | Re-trigger Greptile
Non-home cwds like /tmp/session-123 were presented as usernames, defeating the ambiguity check. Now only /Users/* and /home/* yield a name; anything else prints as '? <path>'.
Adds
skills/pull-from-paper, the paperd counterpart totapes(check the tapes). It looks up sessions the gateway captured for the active org, including teammates' sessions on demand.What it teaches
tapesskill (local SQLite vs org store)paperctl status, interactive-login and doctor guidanceauth_subject: no roster command exists, and--auth-subjectwith an email silently returns zero rows. The skill gives a read-only recipe that maps WorkOS ids to people via the home directory in each session'scwdpaperctl searchvssessions list(sort keys, pagination, the JSON field paths for scripting cost totals)--since/--untilgotcha and the macOS/bin/datetrapsessions get/ scopedexportfor drilling inTesting
TDD'd per writing-skills. Baseline agent (old guidance) on "what did Bekah's sessions cost this week": guessed an email subject (silent empty result), then attributed sessions by content vibes. With this skill: correct id via the cwd recipe on the first try, exact $186.97/4-session answer in 5 read-only calls. Tester friction (undocumented JSON paths, ambiguous non-home cwds) was folded back in.
Refs PCC-1052