@bookedsolid/rea 0.49.0 → 0.50.0

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.
@@ -32,7 +32,13 @@
32
32
  #
33
33
  # # Cache key fields (NUL-joined, sha256-hashed, first 32 hex chars)
34
34
  #
35
- # schema_version — "v1"
35
+ # schema_version — "v2" (0.49.0 Phase 1b: bumped from "v1" for the
36
+ # global-CLI resolver tier. v1 entries on disk are
37
+ # a clean miss — the read-side validator in
38
+ # shim-runtime.sh requires schema_version === "v2".
39
+ # Hard cutover, no migration: the per-session cache
40
+ # is tmpfs + 3600s TTL, so a schema bump is a free
41
+ # drop-and-rebuild.)
36
42
  # session_token — see shim_cache_session_token
37
43
  # project_root_realpath — realpath(CLAUDE_PROJECT_DIR)
38
44
  # cli_realpath — realpath(resolved CLI)
@@ -66,6 +72,21 @@
66
72
  # a swap that re-resolves to the SAME realpath
67
73
  # but with a different binary, e.g. an in-place
68
74
  # rebuild of node itself; rare but cheap)
75
+ # trust_tier — "project" | "global" (0.49.0 Phase 1b). The
76
+ # resolved tier. Makes the key tier-scoped so a
77
+ # symlink that makes project-tier and global-tier
78
+ # `cli_realpath` identical still yields DISTINCT
79
+ # keys — project-tier can never read a global
80
+ # entry's sandbox_ok:true and skip its own
81
+ # containment check (design §8 case (a)).
82
+ # registry_mtime — ns-mtime of <pw_dir>/.rea/trusted-projects on
83
+ # the GLOBAL tier; "" on the project tier (design
84
+ # §8 case (b): atomic-rename on trust/untrust
85
+ # changes the mtime, defeating a warm global hit
86
+ # after the project is untrusted mid-session).
87
+ # registry_size — size-bytes of the registry on the GLOBAL tier;
88
+ # "" on the project tier (a removed line shrinks
89
+ # the file — two invalidators defeat `touch -r`).
69
90
  #
70
91
  # # Storage
71
92
  #
@@ -121,14 +142,19 @@
121
142
  # shim_cache_session_token — prints session token to stdout
122
143
  # (empty + exit 1 means "cache
123
144
  # disabled, no token derivable")
124
- # shim_cache_key — args:
145
+ # shim_cache_key — args (17, in order):
125
146
  # schema_version session_token
126
147
  # project_realpath cli_realpath
127
148
  # cli_mtime cli_size euid
128
149
  # enforce_cli_shape shim_name
129
- # (9 args; the helper accepts
130
- # variadic but the caller in
131
- # shim-runtime always passes 9)
150
+ # pkg_mtime pkg_size dist_mtime
151
+ # node_realpath node_mtime
152
+ # trust_tier registry_mtime
153
+ # registry_size
154
+ # (the helper accepts variadic but
155
+ # rejects fewer than 17 args; the
156
+ # caller in shim-runtime always
157
+ # passes 17 — 0.49.0 Phase 1b)
132
158
  # prints the 32-char hex key
133
159
  # (exit 1 on hash failure → caller
134
160
  # treats as clean miss)
@@ -580,10 +606,11 @@ shim_cache_session_token() {
580
606
  # shim_cache_key SCHEMA SESSION_TOKEN PROJECT_REALPATH CLI_REALPATH \
581
607
  # CLI_MTIME CLI_SIZE EUID ENFORCE_SHAPE SHIM_NAME \
582
608
  # PKG_MTIME PKG_SIZE DIST_DIR_MTIME \
583
- # NODE_REALPATH NODE_MTIME
609
+ # NODE_REALPATH NODE_MTIME \
610
+ # TRUST_TIER REGISTRY_MTIME REGISTRY_SIZE
584
611
  #
585
612
  # Echoes the 32-char hex key on success; empty + exit 1 on hash
586
- # failure. 0.48.0 evolution:
613
+ # failure. Evolution:
587
614
  # - codex round-1 P1: SHIM_NAME added so the cache is hook-scoped
588
615
  # (the skipped probe `rea hook \$SHIM_NAME --help` is hook-specific)
589
616
  # - codex round-3 P1+P2: PKG_MTIME / PKG_SIZE / DIST_DIR_MTIME added
@@ -595,9 +622,16 @@ shim_cache_session_token() {
595
622
  # invalidates the entry (the warm hit would otherwise skip both
596
623
  # node-availability AND the version probe, forwarding through a
597
624
  # different interpreter).
625
+ # - 0.49.0 Phase 1b: TRUST_TIER + REGISTRY_MTIME + REGISTRY_SIZE added
626
+ # (positions 15-17) for the opt-in global-CLI resolver tier. The
627
+ # guard is raised from 14 to 17 args; the SCHEMA is bumped to "v2".
628
+ # ENFORCE_SHAPE (position 8) carries the EFFECTIVE value — "1" when
629
+ # the global tier is in effect (A4 shape is always-on there) OR
630
+ # SHIM_ENFORCE_CLI_SHAPE==1. REGISTRY_MTIME/SIZE are "" on the
631
+ # project tier.
598
632
  # -----------------------------------------------------------------------------
599
633
  shim_cache_key() {
600
- if [ "$#" -lt 14 ]; then
634
+ if [ "$#" -lt 17 ]; then
601
635
  return 1
602
636
  fi
603
637
  _shim_cache_sha256_hex "$@"