@hraness/message-like-me 0.8.4 → 0.8.6

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,122 @@
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 and exit-code selection are unchanged. The paired skill installer adds
22
+ the bounded residual diagnostics described below.
23
+
24
+ ## Publication and receipt recovery
25
+
26
+ A private file and its SQLite receipt are separate durable operations. A scope
27
+ owns a pending publication until the command explicitly retains it. Two-file
28
+ evaluation output retains both files only after both publications succeed. A
29
+ failure publishing the second file rolls back the first only when its custody
30
+ can still be proven; an existing second destination is never overwritten.
31
+
32
+ Study and handoff publication runs receipt recording and recovery without an
33
+ interruption boundary. If recording fails, a read-only exact-binding check reports
34
+ one of four states:
35
+
36
+ - `absent`: the receipt is absent, so cleanup may remove the owned publication.
37
+ - `committed`: the exact receipt exists; keep the publication.
38
+ - `different`: a receipt with that identity has different bindings; keep it.
39
+ - `unproven`: confirmation failed; keep it for inspection.
40
+
41
+ In particular, handoff recording may commit and then fail reading its audit. That
42
+ failure must not delete the handoff. An output-stream failure after a successful
43
+ receipt also leaves the publication intact. These paths preserve the original
44
+ CLI failure message and exit code. Internal callers can inspect
45
+ `PrivatePublicationError.publications` for immutable, body-free path and byte
46
+ digests, receipt state, and cleanup outcome. The report is not printed on stdout
47
+ and creates no retry authority.
48
+
49
+ Native publication creates an exclusive private staging file, syncs it, links it
50
+ without overwriting the destination, removes its own staging link, and syncs the
51
+ directory. Custody is held privately by the native adapter and is derived from
52
+ the created inode. Cleanup checks physical directory identity, ownership, modes,
53
+ link count, file identity, size, timestamps, and content digest. Digest reads use a
54
+ fixed-size buffer and stop at the captured size plus one byte, even if a file grows. It opens without
55
+ following symlinks and has no asynchronous yield between its final identity check
56
+ and unlink. Observed substitutions and unprovable state remain untouched.
57
+
58
+ This is not a filesystem-and-SQLite transaction or a kernel conditional unlink.
59
+ A separate process running as the same user can still race the final path check;
60
+ Effect and TypeScript do not remove that operating-system limitation. Directory
61
+ sync failures after removal are reported as `removed-unconfirmed`. The runtime
62
+ never claims that uncertain cleanup succeeded.
63
+
64
+ ## Paired skill installation
65
+
66
+ The existing command runtime directly composes the fixed `message-like-me` and
67
+ `ensoul` installer. Its program owns preflight, exclusive directory lock, private
68
+ transaction directory, copies, backups, both publish renames, recovery, cleanup,
69
+ and output. Both publish acknowledgements commit the pair immediately. Backup
70
+ cleanup, path confirmation, or stdout failure afterward never rolls it back.
71
+ There is no automatic retry or additional runtime. Admitted native work and
72
+ sequential recovery remain masked until the actual filesystem promises settle.
73
+
74
+ Before creating missing installation parents, read-only preflight rejects
75
+ conflicts, observed source/target overlap, symlinked installation parents, and
76
+ nonphysical source entries. Project anchors resolve existing aliases first;
77
+ missing project directories are then created in order beneath the observed
78
+ physical ancestor. Requested paths allow 4,096 UTF-8 bytes and at most 64 missing
79
+ project components. These directories are retained on later failure. Each
80
+ skill inventory permits at most 64 entries, eight levels, 256 KiB per file, and
81
+ 2 MiB total. These bounds also apply to the old directory on forced replacement.
82
+ Copied types, bytes, and digests must match the admitted source before publication.
83
+ Copies explicitly refuse existing entries. A cooperating installer's existing
84
+ lock is never reclaimed; an ambiguous acquisition is left for inspection.
85
+
86
+ Before publication and cleanup the adapter rechecks observed physical parents
87
+ and entry identities. Recovery runs in reverse pair order; independent actions
88
+ continue after cleanup failure. Restoration requires an absent destination and
89
+ the observed backup. Cleanup removes individually observed leaves and then empty
90
+ directories, retaining unknown or substituted entries. Creating missing parent
91
+ directories is not rolled back. This is observation-bound custody, not a kernel
92
+ conditional unlink, cross-process atomic visibility, hostile same-user race
93
+ immunity, or crash recovery.
94
+
95
+ Clean success stdout is unchanged. Residual cleanup or a postcommit output
96
+ failure adds one stderr warning containing only fixed skill, phase, and commit
97
+ state labels. Private cleanup causes remain internal. The original primary
98
+ rejection, including `undefined`, `null`, or `false`, wins over cleanup and a
99
+ failed warning writer. A successful install with failed warning output instead
100
+ reports that output failure; it does not repeat installation.
101
+
102
+ ## Enforced architecture and distribution
103
+
104
+ `bun run check:effect` uses the repository's TypeScript compiler API and the
105
+ reviewed policy in `scripts/check-effect-architecture.ts`. Only `commands.ts`
106
+ may execute a runtime; native calls belong in `command-platform.ts` or
107
+ `command-artifacts.ts`, or `skill-install-platform.ts`. The installer model and
108
+ program compose under that same command owner. The checker rejects unclassified Effect modules,
109
+ floating Effects, erased channels, unsafe assertions, failure-discard shortcuts,
110
+ suppressions, and selected ambient I/O. Its paired fixtures cover common aliases.
111
+ It does not prove purity, linear lifetime safety, domain correctness, foreign
112
+ cancellation, or every possible JavaScript indirection. Consequential lifecycle,
113
+ publication, native-reader, and contract tests remain required.
114
+
115
+ Effect 3.22.1 is a pinned build dependency bundled into `dist/cli.js`; its
116
+ [MIT license](effect-license.txt) ships with the package. The five
117
+ public protocol JavaScript entries and their declaration graphs build separately
118
+ and expose no Effect dependency. `bun run check:public-graphs` verifies their
119
+ transitive built graphs. The full `bun run check` also keeps typecheck, all tests,
120
+ skill validation, the standalone privacy and local-only scan, fresh-build byte
121
+ comparison, and an isolated packed-consumer install. Release and synthetic
122
+ 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hraness/message-like-me",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
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
  }