git-span 1.0.141 → 1.0.145

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,22 +1,22 @@
1
1
  # git span
2
2
 
3
- `git span` tracks implicit semantic dependencies — line-range or whole-file anchors coupled by nothing a schema, type, test, or build/generator step 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.
3
+ `git span` tracks implicit semantic dependencies — line-range or whole-file anchors coupled by nothing a schema, type, test, or build/generator step enforces. Each span names its anchors, should carry a compact, decision-relevant `why`, and surfaces drift via `git span drift` when anchors diverge from their recorded state.
4
4
 
5
- The primary CLI surface lives in `src/cli/mod.rs`. Run `git span --help` or `git span stale --help` for flag reference.
5
+ The primary CLI surface lives in `src/cli/mod.rs`. Run `git span --help` or `git span drift --help` for flag reference.
6
6
 
7
- ### The stale cache
7
+ ### The drift cache
8
8
 
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.
9
+ `git span drift` (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
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
12
 
13
13
  ### The shared executable-digest store
14
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).
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 drift 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 drift 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).
16
16
 
17
17
  ## Profiling
18
18
 
19
- Perf investigation tooling is documented in [`./docs/profiling.md`](./docs/profiling.md):
19
+ Perf investigation tooling is documented in [Profiling `git span drift`](../../wiki/guides/profiling-git-span-drift.md):
20
20
 
21
21
  - **Flame graph capture** — `perf record` + `inferno-flamegraph` recipe for identifying hot functions.
22
- - **`--perf-trace <path>`** — opt-in per-anchor wall-clock CSV emitter for `git span stale`; CSV schema, usage constraints, and quick analysis snippets are documented there.
22
+ - **`--perf-trace <path>`** — opt-in per-anchor wall-clock CSV emitter for `git span drift`; CSV schema, usage constraints, and quick analysis snippets are documented there.
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.141"
3
+ .TH git-span 1 "git-span 1.0.145"
4
4
  .ie \n(.g .ds Aq \(aq
5
5
  .el .ds Aq '
6
6
  .SH NAME
@@ -18,38 +18,42 @@ Each
18
18
  .B span
19
19
  anchors the participating anchors and carries a durable
20
20
  .I why
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.
21
+ \[em] compact, decision-relevant context shared by the anchored set.
23
22
  .PP
24
23
  The standing question at commit time: did this change create or rely on a
25
24
  coupling that is not visible from the lines themselves?
26
25
  .PP
27
26
  .B Writing the why.
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
33
- \(lqthe runbook,\(rq \(lqthe migration\(rq) rather than repeating filenames.
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.
27
+ Write one or two complete present\-tense clauses in role words. State the
28
+ relationship and any decisive nonlocal authority, invariant, permitted difference,
29
+ lifecycle state, evidence gate, or focused conditional verification. Labels such
30
+ as \(lqAuthority:\(rq and \(lqRemoval gate:\(rq are optional but must introduce
31
+ complete clauses. Include only facts relevant from every anchor. Omit the span
32
+ name, incidental implementation detail, generic work orders, and CLI procedure.
41
33
  .PP
42
34
  .B Re\-anchoring on drift.
43
35
  When
44
- .B git span stale
45
- reports drift, review the change at each anchor.
46
- Because a why only defines, it is inherited across routine re-anchors: if the
47
- subsystem still holds, re-anchor with
36
+ .B git span drift
37
+ reports drift, review the change at each anchor and decide which side of the
38
+ coupling changed deliberately \[em]
39
+ .B git span history
40
+ shows the commit timeline \[em] then bring the other side back into agreement
41
+ before re\-anchoring: a doc anchor that lags a deliberately committed code
42
+ change is updated to match.
43
+ Re\-anchoring records the current content as the anchored baseline with no
44
+ semantic check, so re\-anchoring over a live disagreement conceals it.
45
+ When agreement would require a code change, when the doc may be the intended
46
+ contract rather than a description, or when no deliberate commit explains
47
+ the drift, surface the decision instead of re\-anchoring.
48
+ Inherit the why only while it remains true. For a routine re-anchor, use
48
49
  .B git span add
49
- and commit, leaving the why alone.
50
+ without changing the why.
50
51
  Rewrite it with
51
52
  .B git span why
52
- only when the subsystem itself has changed.
53
+ when the relationship or lifecycle state changes. A satisfied gate authorizes
54
+ its transition; revise or retire the why and every superseded anchor. Require scoped
55
+ .B git span drift
56
+ to report zero drift.
53
57
  .PP
54
58
  Each span is an ordinary tracked file under the span root (default
55
59
  .IR .span ,
@@ -97,7 +101,7 @@ Show the named span — its anchors, why, and config. Equivalent to the bare `gi
97
101
  git\-span\-list(1)
98
102
  List files and anchors currently tracked by a span
99
103
  .TP
100
- git\-span\-stale(1)
104
+ git\-span\-drift(1)
101
105
  Report anchors whose content has drifted from their anchored state
102
106
  .TP
103
107
  git\-span\-add(1)
@@ -106,8 +110,11 @@ Add anchors to a span, writing the span file under the span root. Stage and comm
106
110
  git\-span\-remove(1)
107
111
  Remove anchors from a span, editing the span file under the span root. Stage and commit the change with `git add .span && git commit`
108
112
  .TP
113
+ git\-span\-replace(1)
114
+ Replace one anchor on a span with another address, in a single atomic transaction: either the old identity is retired and the new identity installed together, or nothing changes
115
+ .TP
109
116
  git\-span\-why(1)
110
- Read or stage the span\*(Aqs why — one complete present\-tense sentence defining the subsystem the anchors form together
117
+ Read or stage the span\*(Aqs why — one or two complete present\-tense clauses carrying decision\-relevant nonlocal context
111
118
  .TP
112
119
  git\-span\-delete(1)
113
120
  Delete a span
@@ -119,17 +126,17 @@ git\-span\-tree(1)
119
126
  Trace blast radius: render a clique\-grouped impact tree rooted at the files matched by the given paths/globs
120
127
  .TP
121
128
  git\-span\-merge\-driver(1)
122
- Resolve `.span/` merge conflicts structurally when invoked by git as a merge driver. Receives three clean blob temp files and the marker length from git. Resolves only what is structurally derivable without trusting the worktree (which may be mid\-merge); defers same\-anchor range/hash divergence by writing minimal conflict markers and exiting non\-zero so `git span stale \-\-fix` can finish authoritatively
129
+ Resolve `.span/` merge conflicts structurally when invoked by git as a merge driver. Receives three clean blob temp files and the marker length from git. Resolves only what is structurally derivable without trusting the worktree (which may be mid\-merge); defers same\-anchor range/hash divergence by writing minimal conflict markers and exiting non\-zero so `git span drift \-\-fix` can finish authoritatively
123
130
  .TP
124
131
  git\-span\-history(1)
125
- Show a chronological timeline of a span file\*(Aqs git history: each commit where the span changed, rendered oldest→newest, with the content of any anchor that was added, modified, or removed, and an optional `current` entry describing how the working tree has drifted from HEAD
132
+ Show a span\*(Aqs git history as a git\-log\-style timeline: newest\-first commit entries whose patches are real unified diffs of the span declaration and of each anchor\*(Aqs content at its declared address, with the span\*(Aqs live drift rendered before the first commit as a headerless diff. That drift is not working\-tree\-only: it covers every resolver layer `git span drift` reports, and each block names its observational layers on a `drift source` line. `HEAD` identifies the comparison layer; it does not by itself prove that the declaration or content change was committed. Source order is the resolver\*(Aqs: line ranges use Worktree → Index → Head, while whole\-file anchors use Index → Worktree → Head
126
133
  .TP
127
134
  git\-span\-help(1)
128
135
  Print this message or the help of the given subcommand(s)
129
136
  .ie \n(.g .ds Aq \(aq
130
137
  .el .ds Aq '
131
138
  .SH VERSION
132
- v1.0.141
139
+ v1.0.145
133
140
  .SH EXAMPLES
134
141
  Anchor a new span alongside a code change:
135
142
  .PP
@@ -163,7 +170,7 @@ Check for drift and inspect a span:
163
170
  .PP
164
171
  .RS 4
165
172
  .nf
166
- git span stale
173
+ git span drift
167
174
  git span billing/charge-request-contract
168
175
  git span show billing/charge-request-contract
169
176
  .fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-span",
3
- "version": "1.0.141",
3
+ "version": "1.0.145",
4
4
  "bin": "bin/git-span.exe",
5
5
  "man": [
6
6
  "man/git-span.1"
@@ -24,11 +24,11 @@
24
24
  "scripts/postinstall.js"
25
25
  ],
26
26
  "optionalDependencies": {
27
- "git-span-darwin-arm64": "1.0.141",
28
- "git-span-darwin-x64": "1.0.141",
29
- "git-span-linux-arm64": "1.0.141",
30
- "git-span-linux-x64": "1.0.141",
31
- "git-span-win32-x64": "1.0.141"
27
+ "git-span-darwin-arm64": "1.0.145",
28
+ "git-span-darwin-x64": "1.0.145",
29
+ "git-span-linux-arm64": "1.0.145",
30
+ "git-span-linux-x64": "1.0.145",
31
+ "git-span-win32-x64": "1.0.145"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",