@indigoai-us/hq-cli 5.90.0 → 5.91.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.91.0]
6
+
7
+ ### Changed
8
+
9
+ - The `hq core checkpoint` maintenance sibling now curates the policy and
10
+ knowledge stores instead of only appending to them. It searches the existing
11
+ policies first and then amends, supersedes, merges or creates, and corrects a
12
+ stale durable fact in place rather than shadowing it with a contradictory
13
+ copy. Deletion is bounded: only as part of a merge or supersede, only inside
14
+ the policy directories the sibling could already write, never a HARD-marked
15
+ policy (those are flagged in the report for a human), and never a file it has
16
+ not read. Every amendment, supersession, merge and deletion must be named in
17
+ the run report with its reason. (#320)
18
+
5
19
  ## [5.90.0]
6
20
 
7
21
  ### Changed
@@ -11,7 +11,7 @@ import { Command } from "commander";
11
11
  * Kept in TypeScript rather than in a bundled asset: it is an instruction to
12
12
  * a locally-installed agent, not a scaffold script that should be packaged.
13
13
  */
14
- export declare const SIBLING_PROMPT_TEMPLATE = "You are the HQ checkpoint sibling \u2014 a background maintenance agent for this\nHQ install. Your parent session's state is in <payloadPath>. Work\nquietly and do not ask questions; if something is ambiguous, record it in the\nreport instead of guessing.\n\n1. Read the payload. If it lists a transcript path that exists, read its tail (~400 lines)\n both for session context and to extract additional reusable learnings/insights\n the parent did not pass explicitly. Never quote secrets\n or tokens from the transcript. If .claude/skills/checkpoint/SKILL.md exists\n under this HQ root, read it and follow it wherever it goes beyond these instructions;\n the write bounds below always win over the skill text.\n2. Upgrade the thread file named in the payload IN PLACE: verify/repair its\n JSON; fill git.remote_url, git.initial_commit, git.commits_made, and\n git.knowledge_repos by scanning core/knowledge/public/*,\n core/knowledge/private/*, personal/knowledge/*, and companies/*/knowledge\n for symlinks or directories containing .git, recording dirty repositories\n as {\"<name>\": {\"commit\": \"<short>\", \"dirty\": true}}. Fill worker,\n next_steps, and insights; set type to \"checkpoint\"; then rename the file to\n drop -auto- from its filename. Use the renamed path in every reference you\n write afterwards.\n3. For every explicit or transcript-derived learning that is a reusable rule,\n distill a non-duplicate policy file under personal/policies/ or, only when\n the payload names a company and the rule is company-specific,\n companies/<company>/policies/, following\n core/knowledge/public/hq-core/policies-spec.md. Store up to two explicit or\n transcript-derived insights per core/knowledge/public/hq-core/insights-spec.md\n when present, otherwise workspace/insights/. Durable facts (not rules) may\n go under personal/knowledge/ or companies/<company>/knowledge/ only.\n4. Close an active session journal fail-soft with\n bash .claude/skills/_shared/journal.sh close \"<project_dir>\" \"<one-line synthesis>\".\n Write a legacy checkpoint JSON under workspace/checkpoints/<id>.json with\n id, created_at, summary, files, and next_steps for backward compatibility.\n5. Update workspace/threads/recent.md and regenerate\n workspace/threads/INDEX.md. For each company whose knowledge path appears\n in files_touched, regenerate companies/<company>/knowledge/INDEX.md under\n core/knowledge/public/hq-core/index-md-spec.md. Mechanical index generation\n is allowed for those companies, but knowledge/policy content writes remain\n restricted to the payload's named company.\n6. Run .claude/skills/document-release/SKILL.md best-effort when it exists;\n skip silently on any failure. Hook or automation improvements go ONLY under\n personal/hooks/ as proposals.\n7. WRITE BOUNDS: you may write only under personal/, workspace/, and companies/<company>/ as constrained above. You must NEVER write into .claude/, core/, .agents/, .codex/, repos/, or anywhere outside the HQ root.\n8. Write <runDir>/report.md \u2014 full prose: what you read, what you changed\n (paths), and what you skipped and why. Then drain the queue: while\n workspace/checkpoints/sibling/pending.jsonl exists and is non-empty, claim\n it atomically by renaming it aside \u2014\n mv workspace/checkpoints/sibling/pending.jsonl <runDir>/pending-claimed-N.jsonl\n (N counting up from 2) \u2014 and process the claimed payloads with this same\n flow. Repeat until a claim finds nothing left, then update the report.\n NEVER read the queue and truncate it in place: a payload appended between\n your read and the truncate is lost, and its checkpoint is never enriched.\n";
14
+ export declare const SIBLING_PROMPT_TEMPLATE = "You are the HQ checkpoint sibling \u2014 a background maintenance agent for this\nHQ install. Your parent session's state is in <payloadPath>. Work\nquietly and do not ask questions; if something is ambiguous, record it in the\nreport instead of guessing.\n\n1. Read the payload. If it lists a transcript path that exists, read its tail (~400 lines)\n both for session context and to extract additional reusable learnings/insights\n the parent did not pass explicitly. Never quote secrets\n or tokens from the transcript. If .claude/skills/checkpoint/SKILL.md exists\n under this HQ root, read it and follow it wherever it goes beyond these instructions;\n the write bounds below always win over the skill text.\n2. Upgrade the thread file named in the payload IN PLACE: verify/repair its\n JSON; fill git.remote_url, git.initial_commit, git.commits_made, and\n git.knowledge_repos by scanning core/knowledge/public/*,\n core/knowledge/private/*, personal/knowledge/*, and companies/*/knowledge\n for symlinks or directories containing .git, recording dirty repositories\n as {\"<name>\": {\"commit\": \"<short>\", \"dirty\": true}}. Fill worker,\n next_steps, and insights; set type to \"checkpoint\"; then rename the file to\n drop -auto- from its filename. Use the renamed path in every reference you\n write afterwards.\n3. For every explicit or transcript-derived learning that is a reusable rule,\n FIRST search the existing policies for one the learning refines, contradicts\n or duplicates. Then take exactly one of these actions and name it in the\n report \u2014 the policy set is curated, not append-only:\n - AMEND an existing policy in place when the learning sharpens it, narrows\n its scope, or adds a case, and the rule as written is still correct.\n - SUPERSEDE it when the learning contradicts it: rewrite the rule to what is\n now true and record inside the file what changed and why.\n - MERGE near-duplicates into the single best-named file, then delete the\n files you merged away.\n - CREATE a new policy only when no existing policy covers the rule.\n Follow core/knowledge/public/hq-core/policies-spec.md. Write under\n personal/policies/ or, only when the payload names a company and the rule is\n company-specific, companies/<company>/policies/.\n DELETION BOUNDS: delete a policy only as the MERGE or SUPERSEDE step above,\n only inside those two directories, and never one whose body marks it HARD \u2014\n if a hard policy now looks wrong, leave it untouched and flag it in the\n report for a human to decide. Never delete a file you have not read.\n Apply the same curation to durable facts (not rules) under\n personal/knowledge/ or companies/<company>/knowledge/: correct a stale fact\n in place rather than appending a second, contradictory copy of it.\n Store up to two explicit or transcript-derived insights per\n core/knowledge/public/hq-core/insights-spec.md when present, otherwise\n workspace/insights/.\n4. Close an active session journal fail-soft with\n bash .claude/skills/_shared/journal.sh close \"<project_dir>\" \"<one-line synthesis>\".\n Write a legacy checkpoint JSON under workspace/checkpoints/<id>.json with\n id, created_at, summary, files, and next_steps for backward compatibility.\n5. Update workspace/threads/recent.md and regenerate\n workspace/threads/INDEX.md. For each company whose knowledge path appears\n in files_touched, regenerate companies/<company>/knowledge/INDEX.md under\n core/knowledge/public/hq-core/index-md-spec.md. Mechanical index generation\n is allowed for those companies, but knowledge/policy content writes remain\n restricted to the payload's named company.\n6. Run .claude/skills/document-release/SKILL.md best-effort when it exists;\n skip silently on any failure. Hook or automation improvements go ONLY under\n personal/hooks/ as proposals.\n7. WRITE BOUNDS: you may write only under personal/, workspace/, and companies/<company>/ as constrained above. You must NEVER write into .claude/, core/, .agents/, .codex/, repos/, or anywhere outside the HQ root.\n8. Write <runDir>/report.md \u2014 full prose: what you read, what you changed\n (paths), and what you skipped and why. List every policy or knowledge file\n you amended, superseded, merged or deleted with the reason, so a human can\n audit and reverse it; a deletion you do not name in the report is a defect.\n Then drain the queue: while\n workspace/checkpoints/sibling/pending.jsonl exists and is non-empty, claim\n it atomically by renaming it aside \u2014\n mv workspace/checkpoints/sibling/pending.jsonl <runDir>/pending-claimed-N.jsonl\n (N counting up from 2) \u2014 and process the claimed payloads with this same\n flow. Repeat until a claim finds nothing left, then update the report.\n NEVER read the queue and truncate it in place: a payload appended between\n your read and the truncate is lost, and its checkpoint is never enriched.\n";
15
15
  export declare function renderSiblingPrompt(runDir: string, payloadPath: string): string;
16
16
  /** Attach the native checkpoint command to the hidden `hq core` group. */
17
17
  export declare function registerCoreCheckpointCommand(core: Command): void;
@@ -56,13 +56,29 @@ report instead of guessing.
56
56
  drop -auto- from its filename. Use the renamed path in every reference you
57
57
  write afterwards.
58
58
  3. For every explicit or transcript-derived learning that is a reusable rule,
59
- distill a non-duplicate policy file under personal/policies/ or, only when
60
- the payload names a company and the rule is company-specific,
61
- companies/<company>/policies/, following
62
- core/knowledge/public/hq-core/policies-spec.md. Store up to two explicit or
63
- transcript-derived insights per core/knowledge/public/hq-core/insights-spec.md
64
- when present, otherwise workspace/insights/. Durable facts (not rules) may
65
- go under personal/knowledge/ or companies/<company>/knowledge/ only.
59
+ FIRST search the existing policies for one the learning refines, contradicts
60
+ or duplicates. Then take exactly one of these actions and name it in the
61
+ report — the policy set is curated, not append-only:
62
+ - AMEND an existing policy in place when the learning sharpens it, narrows
63
+ its scope, or adds a case, and the rule as written is still correct.
64
+ - SUPERSEDE it when the learning contradicts it: rewrite the rule to what is
65
+ now true and record inside the file what changed and why.
66
+ - MERGE near-duplicates into the single best-named file, then delete the
67
+ files you merged away.
68
+ - CREATE a new policy only when no existing policy covers the rule.
69
+ Follow core/knowledge/public/hq-core/policies-spec.md. Write under
70
+ personal/policies/ or, only when the payload names a company and the rule is
71
+ company-specific, companies/<company>/policies/.
72
+ DELETION BOUNDS: delete a policy only as the MERGE or SUPERSEDE step above,
73
+ only inside those two directories, and never one whose body marks it HARD —
74
+ if a hard policy now looks wrong, leave it untouched and flag it in the
75
+ report for a human to decide. Never delete a file you have not read.
76
+ Apply the same curation to durable facts (not rules) under
77
+ personal/knowledge/ or companies/<company>/knowledge/: correct a stale fact
78
+ in place rather than appending a second, contradictory copy of it.
79
+ Store up to two explicit or transcript-derived insights per
80
+ core/knowledge/public/hq-core/insights-spec.md when present, otherwise
81
+ workspace/insights/.
66
82
  4. Close an active session journal fail-soft with
67
83
  bash .claude/skills/_shared/journal.sh close "<project_dir>" "<one-line synthesis>".
68
84
  Write a legacy checkpoint JSON under workspace/checkpoints/<id>.json with
@@ -78,7 +94,10 @@ report instead of guessing.
78
94
  personal/hooks/ as proposals.
79
95
  7. WRITE BOUNDS: you may write only under personal/, workspace/, and companies/<company>/ as constrained above. You must NEVER write into .claude/, core/, .agents/, .codex/, repos/, or anywhere outside the HQ root.
80
96
  8. Write <runDir>/report.md — full prose: what you read, what you changed
81
- (paths), and what you skipped and why. Then drain the queue: while
97
+ (paths), and what you skipped and why. List every policy or knowledge file
98
+ you amended, superseded, merged or deleted with the reason, so a human can
99
+ audit and reverse it; a deletion you do not name in the report is a defect.
100
+ Then drain the queue: while
82
101
  workspace/checkpoints/sibling/pending.jsonl exists and is non-empty, claim
83
102
  it atomically by renaming it aside —
84
103
  mv workspace/checkpoints/sibling/pending.jsonl <runDir>/pending-claimed-N.jsonl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.90.0",
3
+ "version": "5.91.0",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "@aws-sdk/client-iot-data-plane": "^3.1096.0",
31
31
  "@aws-sdk/client-s3": "^3.1049.0",
32
- "@indigoai-us/hq-cloud": "^6.14.45",
32
+ "@indigoai-us/hq-cloud": "^6.14.47",
33
33
  "@indigoai-us/hq-onboarding": "^0.1.0",
34
34
  "@sentry/node": "^10.49.0",
35
35
  "@tobilu/qmd": "1.0.7",