@varman96/paper 1.0.4 → 1.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/README.md +67 -25
- package/dist/paper.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Paper captures command failures in a structured Incident Report for coding-agent
|
|
|
4
4
|
|
|
5
5
|
[GitHub](https://github.com/varman96/paper) · [npm](https://www.npmjs.com/package/@varman96/paper)
|
|
6
6
|
|
|
7
|
-
Primary workflow:
|
|
7
|
+
Primary workflow: Run your command normally. If it fails, run Paper.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -14,18 +14,22 @@ npm install -g @varman96/paper
|
|
|
14
14
|
|
|
15
15
|
## Use
|
|
16
16
|
|
|
17
|
-
Run
|
|
17
|
+
Run your command normally:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
$
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
$ npm test
|
|
21
|
+
|
|
22
|
+
FAIL src/router.test.js
|
|
23
|
+
TypeError: primaryAction is not a function
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If it fails, run Paper:
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
```bash
|
|
29
|
+
$ paper run npm test
|
|
26
30
|
```
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
Paper creates `.paper/incident_report.md`:
|
|
29
33
|
|
|
30
34
|
```markdown
|
|
31
35
|
# Incident Report
|
|
@@ -54,37 +58,75 @@ Error: Expected 2 tests to pass, received 1
|
|
|
54
58
|
at runTests (test/runner.js:42:11)
|
|
55
59
|
```
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
Give that report to your coding agent:
|
|
58
62
|
|
|
59
63
|
```text
|
|
60
64
|
Diagnose and fix the failure in .paper/incident_report.md
|
|
61
65
|
```
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
If the command works, you're done.
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
## Commands
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
paper shelf
|
|
69
|
-
```
|
|
71
|
+
- `paper run <command> [args...]` — run a target command through Paper and capture a report if it fails.
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
- `paper shelf` — move the active Incident Report out of the workspace and preserve it in Paper's local shelf.
|
|
74
|
+
|
|
75
|
+
- `paper --help` — print Paper's usage, examples, report location, shelf command, and metadata flags.
|
|
76
|
+
|
|
77
|
+
- `paper --version` — print the installed package version.
|
|
78
|
+
|
|
79
|
+
## Errors
|
|
80
|
+
|
|
81
|
+
> **Warning:** Do not use `paper run` to run Paper itself or commands that invoke Paper recursively. Paper is designed to capture failures from the command being investigated, not its own execution. Running Paper through Paper can produce recursive or misleading incident context.
|
|
82
|
+
|
|
83
|
+
Paper has no numeric or separately registered error-code system. Its own failures use uppercase cause labels in the CLI output:
|
|
84
|
+
|
|
85
|
+
| Label | When it occurs | Meaning and action |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `CLI ENTRYPOINT MISMATCH` | Startup | Paper cannot resolve the executable path to the active CLI entrypoint. Reinstall or relink Paper, then run the command again. |
|
|
88
|
+
| `NO COMMAND` | Argument parsing, with no arguments or with `paper run` alone | No target command was supplied. Use `paper run <command>`. |
|
|
89
|
+
| `INVALID COMMAND` | Argument parsing, when the first argument is not `run` | Paper requires the canonical `paper run <command>` form. |
|
|
90
|
+
| `AGENT RULES WRITE FAILED` | Before `paper run` starts the target | Paper could not create or update the repository's agent-instruction file. Restore write access and run Paper again. |
|
|
91
|
+
| `BINARY MISSING` | Starting the `paper run` target | The target was not found in the active `PATH`. Install it or use a command that exists in the shell. |
|
|
92
|
+
| `PERMISSION DENIED` | Starting the `paper run` target | Paper could not execute the target from the shell. Restore execute permission or use an executable command. |
|
|
93
|
+
| `TARGET START FAILED` | Starting the `paper run` target | The target could not be started for another spawn error. Run it directly in the shell to verify it starts, then run Paper again. |
|
|
94
|
+
| `REPORT WRITE FAILED` | Writing `.paper/incident_report.md` after a target failure | Paper could not persist the Incident Report. Restore write access to the report location and run Paper again. |
|
|
95
|
+
| `NO ACTIVE INCIDENT` | `paper shelf` | `.paper/incident_report.md` was not found, so no files were changed. Run `paper run <command>` first. |
|
|
96
|
+
| `INCIDENT SHELF FAILED` | `paper shelf` while creating the shelf directory or moving the report | Paper could not move the report. The active report is preserved; restore access to the shelf location and run `paper shelf` again. |
|
|
97
|
+
| `PAPER OPERATION FAILED` | An unexpected local operation throws an unclassified error | Paper stopped before the requested operation completed. Resolve the reported local error and run Paper again. |
|
|
98
|
+
|
|
99
|
+
`paper run <command>` also prints `COMMAND FAILED` when the user's command exits nonzero or is terminated by a signal. This is not a Paper error: Paper captured the user's command failure, wrote the Incident Report, and exits successfully if that write succeeds. The command's own stdout/stderr, including errors from its shell or runtime, remain command-generated evidence rather than Paper error labels.
|
|
100
|
+
|
|
101
|
+
### Found a bug?
|
|
102
|
+
|
|
103
|
+
If you encounter a bug or an error that isn't documented here, please let us know.
|
|
104
|
+
|
|
105
|
+
Email **varmanvishnu96@gmail.com**, or join the [Paper Discord](https://discord.gg/9KqwMNTft) and post it in the **#bugs** channel.
|
|
106
|
+
|
|
107
|
+
## How it works
|
|
108
|
+
|
|
109
|
+
Paper is used after a command has failed. `paper run <command>` executes the target command through the local CLI and forwards its stdout and stderr. Before starting it, Paper adds or updates its managed workflow block in the detected agent-instruction file, falling back to `AGENTS.md`.
|
|
110
|
+
|
|
111
|
+
If the target succeeds, `.paper/incident_report.md` is unchanged. If it exits nonzero or is terminated by a signal, Paper traps that failure, captures the evidence locally, writes a structured Incident Report to `.paper/incident_report.md`, and prints `COMMAND FAILED`. The report contains the command, exit code, working directory, timestamp, and stderr or stack trace. Once the report is persisted, Paper exits successfully; Paper-owned failures, such as inability to update instructions or write the report, exit nonzero.
|
|
112
|
+
|
|
113
|
+
The Paper instruction tells coding agents where to find the Incident Report, so an agent can investigate the failure without the user manually copying terminal output. Paper does not diagnose or fix the failure.
|
|
114
|
+
|
|
115
|
+
Paper creates persistent local context and makes it discoverable to the agent. Its operation is local-only and air-gapped: there are no model API calls, telemetry, or command-output uploads.
|
|
116
|
+
|
|
117
|
+
### Shelving an incident
|
|
118
|
+
|
|
119
|
+
Once the incident is resolved, remove it from the active workspace with:
|
|
72
120
|
|
|
73
121
|
```bash
|
|
74
|
-
paper run <command>
|
|
75
122
|
paper shelf
|
|
76
|
-
paper --help
|
|
77
|
-
paper --version
|
|
78
123
|
```
|
|
79
124
|
|
|
80
|
-
|
|
125
|
+
Paper moves `.paper/incident_report.md` out of the repository with a rename and prints the stored path. On Windows, shelved reports are stored under `%LOCALAPPDATA%\Paper\shelf\<repository-hash>\`; on other platforms, under `$XDG_DATA_HOME/Paper/shelf/<repository-hash>/` or `~/.local/share/Paper/shelf/<repository-hash>/`. The report is preserved as a timestamped `.md` file under a repository-specific 16-character SHA-256 directory, but is no longer the active report. The active report is removed from `.paper`, its contents are preserved, and the instruction file is not changed. With no active report, or if the move fails, Paper exits nonzero; a failed move preserves the active report.
|
|
126
|
+
|
|
127
|
+
### Recovering a shelved incident
|
|
81
128
|
|
|
82
|
-
|
|
83
|
-
- Structured Incident Report at `.paper/incident_report.md`.
|
|
84
|
-
- Evidence anchor for coding-agent investigation.
|
|
85
|
-
- Local-only; zero telemetry.
|
|
86
|
-
- No model API calls.
|
|
87
|
-
- No command-output upload.
|
|
129
|
+
Paper currently has no list or recovery command. `paper shelf` prints the exact path of the newly shelved report, which is also how to locate it later. To recover one, manually copy that `.md` file back to the repository as `.paper/incident_report.md`; Paper does not perform this restore or automatically replace an existing active report. Shelving and manual recovery do not update `AGENTS.md`; the existing Paper instruction remains unchanged and will point agents to `.paper/incident_report.md` when that file is present again.
|
|
88
130
|
|
|
89
131
|
## License
|
|
90
132
|
|
package/dist/paper.js
CHANGED
|
@@ -9,7 +9,7 @@ ${s.join(`
|
|
|
9
9
|
|
|
10
10
|
${t.join(`
|
|
11
11
|
|
|
12
|
-
`)}`:""}`}var T={name:"@varman96/paper",version:"1.0.
|
|
12
|
+
`)}`:""}`}var T={name:"@varman96/paper",version:"1.0.5",description:"Paper captures command failures in a structured Incident Report for coding-agent investigation.",main:"dist/paper.js",bin:{paper:"./dist/paper.js"},files:["dist/paper.js","README.md","LICENSE"],directories:{test:"test"},scripts:{"alpha:issue":"node scripts/issue-alpha-access.js","alpha:revoke":"node scripts/revoke-alpha-access.js","fail:test":"node scripts/fail-test.js",paper:"node scripts/paper.js","build:cli":"node scripts/build-cli.js",prepack:"npm run build:cli","deploy:production":"wrangler deploy --env production",test:"node test/run-tests.js","test:fast":"node test/run-tests.js --fast","test:browser":"node test/run-tests.js --browser","test:alpha-browser":"node test/alpha-access.browser.js"},repository:{type:"git",url:"git+https://github.com/varman96/paper.git"},keywords:[],author:"",license:"SEE LICENSE IN LICENSE",type:"module",bugs:{url:"https://github.com/varman96/paper/issues"},homepage:"https://paper-ai.paperhq.workers.dev/",devDependencies:{"@biomejs/biome":"2.5.14",esbuild:"^0.28.1",wrangler:"^4.132.0"}};var J=`Paper captures a failed command and writes a local Incident Report.
|
|
13
13
|
|
|
14
14
|
Usage: paper run <command>
|
|
15
15
|
|