@hraness/message-like-me 0.8.3 → 0.8.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.
@@ -0,0 +1,82 @@
1
+ # Command runtime and private publication
2
+
3
+ `runCommand(argv, io)` remains the Promise boundary used by the CLI. It runs one
4
+ Effect scope for a complete command. `command-program.ts` owns command ordering;
5
+ `CommandPlatform` supplies named native operations, the injected clock and output,
6
+ and scoped stores. A store exposes only declared operations, never the SQLite
7
+ handle. Each successful acquisition closes exactly once. Close failures preserve
8
+ the former `finally` precedence over a command failure.
9
+
10
+ All SQLite transaction callbacks remain synchronous. Ingestion, source overlap,
11
+ corpus revisions, HMAC identities, metrics, profile provenance, canonical digests,
12
+ and the versioned handoff contracts continue to use their existing domain code.
13
+ There is no parallel SQL mutation, network capability, agent invocation, message
14
+ sending, or retry added by this runtime.
15
+
16
+ Command programs declare their success, failure, and required services. Expected
17
+ failures retain the original error as a cause in the closed `CommandFailure`
18
+ union. Native adapters translate source-specific failures at the same boundaries
19
+ as before. The runtime has a narrow compatibility bridge for existing pure
20
+ validators that throw `CliError`; other defects remain defects. CLI text, stdout
21
+ formatting, diagnostics, and exit-code selection are unchanged.
22
+
23
+ ## Publication and receipt recovery
24
+
25
+ A private file and its SQLite receipt are separate durable operations. A scope
26
+ owns a pending publication until the command explicitly retains it. Two-file
27
+ evaluation output retains both files only after both publications succeed. A
28
+ failure publishing the second file rolls back the first only when its custody
29
+ can still be proven; an existing second destination is never overwritten.
30
+
31
+ Study and handoff publication runs receipt recording and recovery without an
32
+ interruption boundary. If recording fails, a read-only exact-binding check reports
33
+ one of four states:
34
+
35
+ - `absent`: the receipt is absent, so cleanup may remove the owned publication.
36
+ - `committed`: the exact receipt exists; keep the publication.
37
+ - `different`: a receipt with that identity has different bindings; keep it.
38
+ - `unproven`: confirmation failed; keep it for inspection.
39
+
40
+ In particular, handoff recording may commit and then fail reading its audit. That
41
+ failure must not delete the handoff. An output-stream failure after a successful
42
+ receipt also leaves the publication intact. These paths preserve the original
43
+ CLI failure message and exit code. Internal callers can inspect
44
+ `PrivatePublicationError.publications` for immutable, body-free path and byte
45
+ digests, receipt state, and cleanup outcome. The report is not printed on stdout
46
+ and creates no retry authority.
47
+
48
+ Native publication creates an exclusive private staging file, syncs it, links it
49
+ without overwriting the destination, removes its own staging link, and syncs the
50
+ directory. Custody is held privately by the native adapter and is derived from
51
+ the created inode. Cleanup checks physical directory identity, ownership, modes,
52
+ link count, file identity, size, timestamps, and content digest. Digest reads use a
53
+ fixed-size buffer and stop at the captured size plus one byte, even if a file grows. It opens without
54
+ following symlinks and has no asynchronous yield between its final identity check
55
+ and unlink. Observed substitutions and unprovable state remain untouched.
56
+
57
+ This is not a filesystem-and-SQLite transaction or a kernel conditional unlink.
58
+ A separate process running as the same user can still race the final path check;
59
+ Effect and TypeScript do not remove that operating-system limitation. Directory
60
+ sync failures after removal are reported as `removed-unconfirmed`. The runtime
61
+ never claims that uncertain cleanup succeeded.
62
+
63
+ ## Enforced architecture and distribution
64
+
65
+ `bun run check:effect` uses the repository's TypeScript compiler API and the
66
+ reviewed policy in `scripts/check-effect-architecture.ts`. Only `commands.ts`
67
+ may execute a runtime; native calls belong in `command-platform.ts` or
68
+ `command-artifacts.ts`. The checker rejects unclassified Effect modules,
69
+ floating Effects, erased channels, unsafe assertions, failure-discard shortcuts,
70
+ suppressions, and selected ambient I/O. Its paired fixtures cover common aliases.
71
+ It does not prove purity, linear lifetime safety, domain correctness, foreign
72
+ cancellation, or every possible JavaScript indirection. Consequential lifecycle,
73
+ publication, native-reader, and contract tests remain required.
74
+
75
+ Effect 3.22.1 is a pinned build dependency bundled into `dist/cli.js`; its
76
+ [MIT license](effect-license.txt) ships with the package. The five
77
+ public protocol JavaScript entries and their declaration graphs build separately
78
+ and expose no Effect dependency. `bun run check:public-graphs` verifies their
79
+ transitive built graphs. The full `bun run check` also keeps typecheck, all tests,
80
+ skill validation, the standalone privacy and local-only scan, fresh-build byte
81
+ comparison, and an isolated packed-consumer install. Release and synthetic
82
+ macOS gates remain governed by the existing publication runbook.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Effectful Technologies Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -727,6 +727,15 @@ the same checked explicit-lease fast-forward and requires one new provider
727
727
  outcome. A baseline-preserving range uses the frozen v1 no-digest receipt; a
728
728
  workflow-changing range requires the exact independently reviewed v2 digest and
729
729
  recomputes its old-through-current-workflow-source inventory before authority.
730
+ The sterile writer fetches only the exact verified tag, with one more commit of
731
+ history than the admitted workflow range, and proves the expected production
732
+ commit is its ancestor before pushing. Missing ancestry or a non-fast-forward
733
+ target fails before the ref can move; the push receipt must still report one
734
+ ordinary fast-forward rather than a forced update. Because exactly one of the
735
+ advance and already-exact jobs is intentionally skipped, every job after path
736
+ selection has an explicit skip-aware status condition. The final public
737
+ admission runs as a terminal sentinel and fails unless verification and provider
738
+ admission both succeeded, so a skipped tail cannot make the workflow green.
730
739
  If the ref is already exact, the baseline marks advancement false, skips the
731
740
  entire `production-ref-writer-key` job, and mints no App token. A separate
732
741
  read-only job accepts only the unique latest exact-SHA Production deployment in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hraness/message-like-me",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "A local-first CLI and Agent Skill for studying private messaging history and drafting messages that sound like you.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -77,11 +77,14 @@
77
77
  "check:standalone": "bun scripts/check-standalone.ts",
78
78
  "check:dist": "bun scripts/check-dist.ts",
79
79
  "check:package": "bun scripts/package-smoke.ts",
80
- "check": "bun run typecheck && bun run test && bun run check:skill && bun run check:standalone && bun run build && bun run check:dist && bun run check:package",
81
- "prepack": "bun run check"
80
+ "check": "bun run typecheck && bun run check:effect && bun run test && bun run check:skill && bun run check:standalone && bun run build && bun run check:public-graphs && bun run check:dist && bun run check:package",
81
+ "prepack": "bun run check",
82
+ "check:effect": "bun scripts/check-effect-architecture.ts",
83
+ "check:public-graphs": "bun scripts/check-public-graphs.ts"
82
84
  },
83
85
  "devDependencies": {
84
86
  "@types/bun": "1.3.14",
87
+ "effect": "3.22.1",
85
88
  "sigstore": "4.1.1",
86
89
  "typescript": "6.0.3"
87
90
  }