git-span 1.1.25 → 1.1.27

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
@@ -61,6 +61,25 @@ Install integrations separately after putting `git span` on `PATH`. See [git-spa
61
61
 
62
62
  Commands with `--format json` provide machine-readable output. `git span context <address>... --format json` returns an exact repository snapshot for paths and inclusive line ranges, including selected spans, whys, current status, and resolver sources. Published JSON Schemas and their contracts are documented at [git-span.com](https://git-span.com).
63
63
 
64
+ ## Commit-associated JSON notes
65
+
66
+ Attach arbitrary supporting JSON to a commit and consume records by their sequential IDs:
67
+
68
+ ```bash
69
+ git span notes add HEAD '{"session_id":"session-42"}'
70
+ git span notes add HEAD < metadata.json
71
+ git span notes list main..feature --format json
72
+ git span notes list HEAD --exact --format json
73
+ git span notes show 1 --format json
74
+ git span notes remove 1 --format json
75
+ ```
76
+
77
+ Every leaf accepts `--format human|json`. Machine output is a schema-version 1 envelope with `operation` and an ascending `notes` array; each record contains numeric `id`, full `commit_sha`, and parsed `document`. Empty lists contain `notes: []`; add/show/remove return one record, including the deleted record for removal.
78
+
79
+ Notes remain in the clone's shared Git directory until removed, independently of resolver-cache maintenance. IDs are atomic across worktrees, never reused, and bounded to JavaScript-safe positive integers. Retrying identical JSON on the same commit returns its existing ID: object key order and decoded string escapes do not matter, arrays retain order, and the parser's arbitrary-precision numeric representation is significant (`1` differs from `1.0`). The full commit association survives branch movement.
80
+
81
+ Input accepts one UTF-8 JSON value from an argument or nonterminal stdin, up to 16 MiB with bounded nesting. Invalid/conflicting input, ambiguous or noncommit revisions, missing IDs, and incompatible/corrupt storage fail without a success result. Notes provide local storage and Git selection; clients own processing and there is no remote synchronization. See the [command reference](https://git-span.com/docs/commands#notes-add) for the complete contract.
82
+
64
83
  ## Documentation
65
84
 
66
85
  - [git-span.com](https://git-span.com) — installation, concepts, command reference, agent integration, and CI guidance
package/man/git-span.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" GENERATED by gen-manpage. Do not edit by hand.
2
2
  .ie \n(.g .ds Aq \(aq
3
3
  .el .ds Aq '
4
- .TH git-span 1 "git-span 1.1.25"
4
+ .TH git-span 1 "git-span 1.1.27"
5
5
  .ie \n(.g .ds Aq \(aq
6
6
  .el .ds Aq '
7
7
  .SH NAME
@@ -98,6 +98,9 @@ Print version
98
98
  .el .ds Aq '
99
99
  .SH SUBCOMMANDS
100
100
  .TP
101
+ git\-span\-notes(1)
102
+ Attach, inspect, and remove durable arbitrary JSON documents associated with commits
103
+ .TP
101
104
  git\-span\-show(1)
102
105
  Show the named span — its anchors, why, and config. The bare `git span <name>` positional form is equivalent to `git span show <name>`
103
106
  .TP
@@ -148,7 +151,41 @@ Print this message or the help of the given subcommand(s)
148
151
  .ie \n(.g .ds Aq \(aq
149
152
  .el .ds Aq '
150
153
  .SH VERSION
151
- v1.1.25
154
+ v1.1.27
155
+ .SH COMMIT-ASSOCIATED JSON NOTES
156
+ .B git span notes add <git-ref> [<json>] [--format human|json]
157
+ attaches one arbitrary UTF-8 JSON value to an unambiguous commit, peeling annotated tags.
158
+ Omit the JSON argument to read nonterminal stdin. Missing terminal input, empty or
159
+ invalid JSON, excessive nesting, input over 16 MiB, and nonempty stdin combined with
160
+ an argument fail before storage mutation. Tree/blob objects and options are refused.
161
+ .PP
162
+ .B git span notes list [<git-ref>] [--exact] [--format human|json]
163
+ returns records by ascending ID. Without a revision it includes unreachable commits;
164
+ a tip selects reachable history, and two-dot/three-dot ranges use native Git sets,
165
+ including omitted-endpoint HEAD defaults. Exact mode requires one revision.
166
+ .PP
167
+ .B git span notes show <note-id> [--format human|json]
168
+ returns one document and its full SHA association.
169
+ .B git span notes remove <note-id> [--format human|json]
170
+ deletes only that ID and returns the deleted record. Missing/invalid IDs fail.
171
+ .PP
172
+ Each new ID is a repository-wide positive integer through 9007199254740991,
173
+ allocated atomically across worktrees, never reused after removal or restart.
174
+ Retrying an identical still-present document on the same SHA returns its existing ID.
175
+ Identity sorts object keys, decodes strings, preserves array order and arbitrary-precision
176
+ parsed numeric representation (1 differs from 1.0); parser-normalized exponent spellings
177
+ agree and duplicate object keys use their last value. Associations use frozen full SHAs.
178
+ .PP
179
+ JSON output is one schema_version 1 envelope with operation and notes fields.
180
+ Every note has numeric id, full commit_sha, and parsed document.
181
+ Add/show/remove return one record; empty lists return an empty notes array.
182
+ Human is the default format. Storage/selection failures emit no JSON success.
183
+ .PP
184
+ Notes remain at <git-common-dir>/span/notes.db until explicitly removed,
185
+ independent of disposable resolver cache state and span-root settings.
186
+ Corrupt, foreign, or incompatible storage is left intact and refused;
187
+ lock contention fails after a 30-second busy timeout. There is no migration,
188
+ remote synchronization, native Git-notes interchange, or processing lifecycle.
152
189
  .SH EXAMPLES
153
190
  Anchor a new span alongside a code change:
154
191
  .PP
@@ -187,6 +224,19 @@ git span billing/charge-request-contract
187
224
  git span show billing/charge-request-contract
188
225
  .fi
189
226
  .RE
227
+ .PP
228
+ Attach and consume a commit-associated JSON record:
229
+ .PP
230
+ .RS 4
231
+ .nf
232
+ git span notes add HEAD '{"session_id":"session-42"}'
233
+ git span notes add HEAD < metadata.json
234
+ git span notes list main..feature --format json
235
+ git span notes list HEAD --exact --format json
236
+ git span notes show 1 --format json
237
+ git span notes remove 1 --format json
238
+ .fi
239
+ .RE
190
240
  .SH SEE ALSO
191
241
  .BR git (1),
192
242
  .BR gitcli (7)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-span",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "bin": "bin/git-span.exe",
5
5
  "man": [
6
6
  "man/git-span.1"
@@ -27,11 +27,11 @@
27
27
  "scripts/postinstall.js"
28
28
  ],
29
29
  "optionalDependencies": {
30
- "git-span-darwin-arm64": "1.1.25",
31
- "git-span-darwin-x64": "1.1.25",
32
- "git-span-linux-arm64": "1.1.25",
33
- "git-span-linux-x64": "1.1.25",
34
- "git-span-win32-x64": "1.1.25"
30
+ "git-span-darwin-arm64": "1.1.27",
31
+ "git-span-darwin-x64": "1.1.27",
32
+ "git-span-linux-arm64": "1.1.27",
33
+ "git-span-linux-x64": "1.1.27",
34
+ "git-span-win32-x64": "1.1.27"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",