@davesheffer/hunch 1.40.1 → 1.41.1

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.
@@ -505,6 +505,14 @@ export declare class HunchStore {
505
505
  * newest-first, with its valid-time window and supersession links. Answers
506
506
  * "what did we believe, and when/why did it change?" (hunch_timeline). */
507
507
  timeline(target: string): Decision[];
508
+ /** Invalidate, don't delete: close an active constraint's valid-time window
509
+ * (status → "retired", valid_to → now) so `hunch check` and the strict hook
510
+ * stop enforcing it while its full history stays on record. The caller has
511
+ * already resolved `existing` (id lookup + already-retired refusal are the
512
+ * CLI's job, not this method's), so there is no internal re-lookup and no
513
+ * nullable return. Writes to whichever store already holds the record
514
+ * (`putWhereItLives`), so a public/private twin can never be forked. */
515
+ retireConstraint(existing: Constraint): Constraint;
508
516
  /** Invalidate, don't delete (Zep edge-invalidation): close `oldId`'s valid-time
509
517
  * window at the superseding decision's `valid_from`, mark it superseded + linked,
510
518
  * and write a `supersedes` edge. Returns the updated old decision, or null if it
@@ -148,7 +148,10 @@ export class HunchStore {
148
148
  const distinctNestedRoot = nestedBoundary ? gitWorktreeRoot(publicationProbe) : null;
149
149
  if (canonical(candidate) === canonical(this.paths.hunch) ||
150
150
  (nestedBoundary && (!distinctNestedRoot || sameGitPublication(distinctNestedRoot, this.paths.root))) ||
151
- sameGitPublication(publicationProbe, this.paths.root)) {
151
+ // If these paths are identical, the nested-boundary clause just ran
152
+ // this exact proof. Different probe paths still need their own check;
153
+ // no result is retained across store opens or publication operations.
154
+ (distinctNestedRoot !== publicationProbe && sameGitPublication(publicationProbe, this.paths.root))) {
152
155
  throw new Error(`Unsafe private overlay "${candidate}" shares the public code repository's local or remote publication boundary. ` +
153
156
  "Run `hunch private` or `hunch shared --repo <url>` to create a standalone overlay repository.");
154
157
  }
@@ -1846,6 +1849,16 @@ export class HunchStore {
1846
1849
  timeline(target) {
1847
1850
  return this.why(target).decisions.sort((a, b) => (b.valid_from ?? b.date).localeCompare(a.valid_from ?? a.date));
1848
1851
  }
1852
+ /** Invalidate, don't delete: close an active constraint's valid-time window
1853
+ * (status → "retired", valid_to → now) so `hunch check` and the strict hook
1854
+ * stop enforcing it while its full history stays on record. The caller has
1855
+ * already resolved `existing` (id lookup + already-retired refusal are the
1856
+ * CLI's job, not this method's), so there is no internal re-lookup and no
1857
+ * nullable return. Writes to whichever store already holds the record
1858
+ * (`putWhereItLives`), so a public/private twin can never be forked. */
1859
+ retireConstraint(existing) {
1860
+ return this.putWhereItLives("constraints", { ...existing, status: "retired", valid_to: new Date().toISOString() });
1861
+ }
1849
1862
  /** Invalidate, don't delete (Zep edge-invalidation): close `oldId`'s valid-time
1850
1863
  * window at the superseding decision's `valid_from`, mark it superseded + linked,
1851
1864
  * and write a `supersedes` edge. Returns the updated old decision, or null if it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davesheffer/hunch",
3
- "version": "1.40.1",
3
+ "version": "1.41.1",
4
4
  "mcpName": "io.github.davesheffer/hunch",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Dave Sheffer <dave.sheffer1@gmail.com>",
package/server.json CHANGED
@@ -7,13 +7,13 @@
7
7
  "source": "github"
8
8
  },
9
9
  "websiteUrl": "https://www.hunchmemory.com",
10
- "version": "1.40.1",
10
+ "version": "1.41.1",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "registryBaseUrl": "https://registry.npmjs.org",
15
15
  "identifier": "@davesheffer/hunch",
16
- "version": "1.40.1",
16
+ "version": "1.41.1",
17
17
  "runtimeHint": "npx",
18
18
  "packageArguments": [
19
19
  {