Skip to content

✨ feat: add pull-from-paper skill - #5

Merged
bdougie merged 2 commits into
mainfrom
pull-from-paper-skill
Jul 30, 2026
Merged

✨ feat: add pull-from-paper skill#5
bdougie merged 2 commits into
mainfrom
pull-from-paper-skill

Conversation

@bdougie

@bdougie bdougie commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Adds skills/pull-from-paper, the paperd counterpart to tapes (check the tapes). It looks up sessions the gateway captured for the active org, including teammates' sessions on demand.

What it teaches

  • Disambiguation from the tapes skill (local SQLite vs org store)
  • Preflight with paperctl status, interactive-login and doctor guidance
  • Resolving a person to an auth_subject: no roster command exists, and --auth-subject with 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's cwd
  • Org-wide semantic paperctl search vs sessions list (sort keys, pagination, the JSON field paths for scripting cost totals)
  • RFC3339 --since/--until gotcha and the macOS /bin/date trap
  • sessions get / scoped export for drilling in

Testing

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

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
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a new skill for retrieving Paper organization sessions through paperctl.

  • Documents preflight and authentication recovery.
  • Explains teammate identity resolution, search and listing workflows, time filters, cost aggregation, and transcript export.
  • Adds the skill to the README catalog.

Confidence Score: 4/5

The identity-resolution pipeline should be fixed before merging because non-home working directories can cause sessions to be attributed to the wrong teammate.

The pipeline strips each cwd down to its third path component without first validating a supported home-directory form, making acknowledged ambiguous paths indistinguishable from legitimate usernames.

Files Needing Attention: skills/pull-from-paper/SKILL.md

Important Files Changed

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
Loading
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

@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown

PCC-1052

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>'.
@bdougie
bdougie merged commit bef09c9 into main Jul 30, 2026
4 checks passed
@bdougie
bdougie deleted the pull-from-paper-skill branch July 30, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant