git-span 1.0.134 → 1.0.137

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
@@ -1,14 +1,18 @@
1
1
  # git span
2
2
 
3
- `git span` tracks implicit semantic dependencies in a git repository — line-range or whole-file anchors that participate in a coupling no schema, type, or test enforces. Each span names its anchors, optionally carries a `why` sentence defining the subsystem they collectively form (recommended on every span), and surfaces drift via `git span stale` when those anchors diverge from their anchored state.
3
+ `git span` tracks implicit semantic dependencies in a git repository — line-range or whole-file anchors that participate in a coupling no schema, type, or test enforces. Each span names its anchors, optionally carries a `why` — one present-tense sentence defining the subsystem they form together (recommended on every span), and surfaces drift via `git span stale` when those anchors diverge from their anchored state.
4
4
 
5
5
  The primary CLI surface lives in `src/cli/mod.rs`. Run `git span --help` or `git span stale --help` for flag reference.
6
6
 
7
- ### Upgrading from the sqlite cache
7
+ ### The stale cache
8
8
 
9
- The trail cache now lives at `<common_dir>/span/cache/v1/` as a BLAKE3-keyed content-addressed filesystem store. The previous sqlite-backed cache at `<common_dir>/span/cache/span_cache.sqlite` (or `<git_dir>/span/cache/span_cache.sqlite` on older per-worktree installations), along with its `-shm` and `-wal` companions, is unused and can be removed with a single `rm -f <common_dir>/span/cache/span_cache.sqlite*` (and the `<git_dir>` variant if present). Nothing reads those files anymore.
9
+ `git span stale` (and related resolution paths) are backed by a single persistent cache: a SQLite database at `<common_dir>/span/store.db` (plus its `-wal` and `-shm` companions), implemented in `src/resolver/store/`. This is the whole on-disk cache footprint — remove `store.db*` to reset it. Setting `GIT_SPAN_CACHE=0` disables it for a run.
10
10
 
11
- Separately, and unrelated to the sqlite cache above, `git span stale` (and related resolution paths) are backed by a second, currently-active cache: a SQLite database at `<common_dir>/span/stale-cache.db` (see `src/resolver/cache_v2/schema.rs`). Cleanup of the on-disk footprint needs to account for both stores — the `cache/v1/` filesystem store and `stale-cache.db` (plus its `-shm`/`-wal` companions) — not just one.
11
+ The store is bounded by a byte high-water mark (256 MiB by default; override with `GIT_SPAN_STORE_MAX_BYTES` or `git config git-span.storeMaxBytes`), with transactional GC that runs only when a publish crosses the cap. It lives in the Git *common* directory, so it is shared across linked worktrees of one clone on one host; it is not shared cross-host or cross-clone. Earlier releases kept two separate caches (a `cache/v1/` filesystem trail store and a `stale-cache.db`); both were replaced by this one store and leave no files behind on a fresh clone.
12
+
13
+ ### The shared executable-digest store
14
+
15
+ A configured filter driver's resolved executable (e.g. a `git-lfs` install) is content-hashed to prove its identity as part of every state-token capture. That hash is a fact about a file on the local machine, not about any one repository, so it is memoized in a *second*, small, per-user SQLite database — separate from the per-repo stale cache above — at `$GIT_SPAN_CACHE_HOME/exe-digest.db`, defaulting to `$HOME/.cache/git-span/exe-digest.db` (mirrors the workspace's `$HOME/.cache/git-span/cargo-target/` per-user build-artifact directory). Every repository on a machine that shares the same filter executable reuses the same memoized digest instead of re-hashing it per clone. `GIT_SPAN_EXE_DIGEST_DB` overrides the database file path directly (useful for CI isolation). `GIT_SPAN_CACHE=0` disables this store too, exactly like the stale cache. Implemented in `src/resolver/core/exe_digest_store.rs`; safe to delete at any time (it is rebuilt lazily, fail-closed on any error — a missing or broken database just means every executable is re-hashed).
12
16
 
13
17
  ## Profiling
14
18
 
package/man/git-span.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .ie \n(.g .ds Aq \(aq
2
2
  .el .ds Aq '
3
- .TH git-span 1 "git-span 1.0.134"
3
+ .TH git-span 1 "git-span 1.0.137"
4
4
  .ie \n(.g .ds Aq \(aq
5
5
  .el .ds Aq '
6
6
  .SH NAME
@@ -18,32 +18,38 @@ Each
18
18
  .B span
19
19
  anchors the participating anchors and carries a durable
20
20
  .I why
21
- \[em] one prose sentence that names the relationship the anchored set holds
22
- and survives a rewrite of either side.
21
+ \[em] one present-tense sentence that defines the subsystem the anchored set
22
+ forms together and stays true across a rewrite of either side.
23
23
  .PP
24
24
  The standing question at commit time: did this change create or rely on a
25
25
  coupling that is not visible from the lines themselves?
26
26
  .PP
27
27
  .B Writing the why.
28
- Name the relationship the anchors hold in one prose sentence, written so it
29
- survives a rewrite of either side.
30
- Describe the relationship in role\-words (\(lqthe doc,\(rq \(lqthe parser,\(rq
28
+ Write one complete sentence, in the present tense, that defines the subsystem
29
+ the anchors form together: name the thing, then say what it does across the
30
+ anchors.
31
+ Give it a subject and a verb \[em] never a label followed by a colon \[em] and
32
+ name the thing in role\-words (\(lqthe doc,\(rq \(lqthe parser,\(rq
31
33
  \(lqthe runbook,\(rq \(lqthe migration\(rq) rather than repeating filenames.
32
- For asymmetric relationships, name which side is normative:
33
- \(lqthe doc is the source of truth when they disagree.\(rq
34
- Do not restate the span name, embed incidental implementation details, or
35
- bundle ownership and review triggers in the why.
34
+ A why is read when a hook surfaces it mid\-task, so make it specific enough
35
+ that a reader who just edited one anchor can tell from the sentence alone
36
+ whether their change lands inside the thing it names.
37
+ Do not restate the span name or embed incidental implementation details, and
38
+ keep invariants, caveats, ownership, and review triggers out of the why \[em]
39
+ those belong in comments at the anchor sites, in commit messages, CODEOWNERS,
40
+ and PR descriptions.
36
41
  .PP
37
42
  .B Re\-anchoring on drift.
38
43
  When
39
44
  .B git span stale
40
45
  reports drift, review the change at each anchor.
41
- If the relationship still holds, re-anchor with
46
+ Because a why only defines, it is inherited across routine re-anchors: if the
47
+ subsystem still holds, re-anchor with
42
48
  .B git span add
43
- and commit.
44
- If the relationship has changed, update the why with
49
+ and commit, leaving the why alone.
50
+ Rewrite it with
45
51
  .B git span why
46
- before re-anchoring.
52
+ only when the subsystem itself has changed.
47
53
  .PP
48
54
  Each span is an ordinary tracked file under the span root (default
49
55
  .IR .span ,
@@ -101,7 +107,7 @@ git\-span\-remove(1)
101
107
  Remove anchors from a span, editing the span file under the span root. Stage and commit the change with `git add .span && git commit`
102
108
  .TP
103
109
  git\-span\-why(1)
104
- Read or stage the span\*(Aqs why — a one\-sentence definition of the subsystem, flow, or concern the anchors collectively form
110
+ Read or stage the span\*(Aqs why — one complete present\-tense sentence defining the subsystem the anchors form together
105
111
  .TP
106
112
  git\-span\-delete(1)
107
113
  Delete a span
@@ -123,7 +129,7 @@ Print this message or the help of the given subcommand(s)
123
129
  .ie \n(.g .ds Aq \(aq
124
130
  .el .ds Aq '
125
131
  .SH VERSION
126
- v1.0.134
132
+ v1.0.137
127
133
  .SH EXAMPLES
128
134
  Anchor a new span alongside a code change:
129
135
  .PP
@@ -132,8 +138,8 @@ Anchor a new span alongside a code change:
132
138
  git span add billing/charge-request-contract \e
133
139
  docs/api/charge.md#L40-L88 api/charge.ts#L30-L76
134
140
  git span why billing/charge-request-contract \e
135
- -m "The doc states the request body shape the parser honors; \e
136
- the doc is the source of truth when they disagree."
141
+ -m "The charge request body shape is stated by the doc \e
142
+ and honored by the parser that reads it."
137
143
  git add .span
138
144
  git commit -m "Wire checkout to charge API"
139
145
  .fi
@@ -147,7 +153,8 @@ git span add auth/token-contract --at HEAD \e
147
153
  packages/auth/token.ts#L88-L104 \e
148
154
  packages/auth/crypto.ts#L12-L40
149
155
  git span why auth/token-contract \e
150
- -m "Token verification depends on signature verification."
156
+ -m "Session token verification checks signatures with the \e
157
+ algorithm and key encoding the crypto helper defines."
151
158
  git add .span && git commit -m "Document token/crypto coupling"
152
159
  .fi
153
160
  .RE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-span",
3
- "version": "1.0.134",
3
+ "version": "1.0.137",
4
4
  "bin": "bin/git-span.exe",
5
5
  "man": [
6
6
  "man/git-span.1"
@@ -15,7 +15,7 @@
15
15
  "lint": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/check\" cargo clippy --quiet --locked -- -D warnings",
16
16
  "typecheck": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 RUSTFLAGS=\"-W unused -W dead-code\" CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/check\" cargo check --quiet --locked",
17
17
  "bench:check": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo bench --no-run --locked --features bench-corpus",
18
- "bench": "bash scripts/with-target-lock.sh shared env CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo bench --locked",
18
+ "bench": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/build\" cargo bench --locked",
19
19
  "udeps": "bash scripts/with-target-lock.sh shared env CARGO_BUILD_JOBS=1 CARGO_TARGET_DIR=\"${GIT_SPAN_CARGO_TARGET_ROOT:-$HOME/.cache/git-span/cargo-target}/git-span/udeps\" cargo +nightly udeps"
20
20
  },
21
21
  "files": [
@@ -24,11 +24,11 @@
24
24
  "scripts/postinstall.js"
25
25
  ],
26
26
  "optionalDependencies": {
27
- "git-span-darwin-arm64": "1.0.134",
28
- "git-span-darwin-x64": "1.0.134",
29
- "git-span-linux-arm64": "1.0.134",
30
- "git-span-linux-x64": "1.0.134",
31
- "git-span-win32-x64": "1.0.134"
27
+ "git-span-darwin-arm64": "1.0.137",
28
+ "git-span-darwin-x64": "1.0.137",
29
+ "git-span-linux-arm64": "1.0.137",
30
+ "git-span-linux-x64": "1.0.137",
31
+ "git-span-win32-x64": "1.0.137"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",