@handsupmin/gc-tree 0.4.1 → 0.4.2

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/dist/src/cli.js CHANGED
@@ -11,6 +11,7 @@ import { scaffoldHostIntegration } from './scaffold.js';
11
11
  import { requirePreferredProvider, writeSettings, readSettings } from './settings.js';
12
12
  import { checkoutBranch, initHome, listBranches, readHead, resetBranchContext, statusForBranch, ensureBranchExists, isBranchContextEmpty } from './store.js';
13
13
  import { updateBranchContext } from './update.js';
14
+ import { verifyOnboarding } from './verify-onboarding.js';
14
15
  function readArg(flag) {
15
16
  const index = process.argv.indexOf(flag);
16
17
  return index === -1 ? undefined : process.argv[index + 1];
@@ -28,6 +29,7 @@ function usage() {
28
29
  gctree set-repo-scope --branch NAME [--repo NAME] [--cwd DIR] (--include|--exclude) [--home DIR]
29
30
  gctree status [--home DIR] [--cwd DIR]
30
31
  gctree onboard [--home DIR] [--branch NAME] [--provider <codex|claude-code>] [--target DIR] [--no-launch]
32
+ gctree verify-onboarding [--home DIR] [--branch NAME]
31
33
  gctree reset-gc-branch [--home DIR] [--branch NAME] --yes
32
34
  gctree resolve --query TEXT [--home DIR] [--branch NAME] [--cwd DIR]
33
35
  gctree show-doc --id ID [--home DIR] [--branch NAME]
@@ -246,6 +248,12 @@ async function main() {
246
248
  console.log(JSON.stringify({ mode: 'guided_onboarding', gc_branch: gcBranch, preferred_provider: provider, scaffold, launch }, null, 2));
247
249
  return;
248
250
  }
251
+ case 'verify-onboarding': {
252
+ const gcBranch = readArg('--branch') || (await readHead(home)) || DEFAULT_BRANCH;
253
+ const result = await verifyOnboarding({ home, branch: gcBranch });
254
+ console.log(JSON.stringify(result, null, 2));
255
+ return;
256
+ }
249
257
  case '__apply-onboarding': {
250
258
  const inputPath = readArg('--input');
251
259
  if (!inputPath)
@@ -28,6 +28,8 @@ export function onboardingProtocolLines() {
28
28
  }
29
29
  export function onboardingCompletionLines() {
30
30
  return [
31
+ 'Before you claim onboarding is complete, run `gctree verify-onboarding --branch <current-gc-branch>` and inspect the real gc-tree files.',
32
+ 'Do not claim onboarding is complete unless verification returns `status: "complete"`.',
31
33
  'After applying the onboarding docs, explicitly list which durable docs were saved.',
32
34
  'Then summarize what you now understand from the saved docs instead of stopping at the filenames alone.',
33
35
  'Ask whether that final summary matches the user\'s reality, and capture any corrections before you wrap up.',
@@ -0,0 +1,24 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { parseIndexEntries } from './markdown.js';
3
+ import { branchIndexPath, DEFAULT_BRANCH } from './paths.js';
4
+ import { ensureBranchExists, statusForBranch } from './store.js';
5
+ export async function verifyOnboarding({ home, branch, }) {
6
+ const gcBranch = branch || DEFAULT_BRANCH;
7
+ await ensureBranchExists(home, gcBranch);
8
+ const status = await statusForBranch(home, gcBranch);
9
+ const indexRaw = await readFile(branchIndexPath(home, gcBranch), 'utf8');
10
+ const docs = parseIndexEntries(indexRaw);
11
+ const indexedDocCount = docs.length;
12
+ const complete = status.doc_count > 0 && indexedDocCount > 0;
13
+ return {
14
+ status: complete ? 'complete' : 'incomplete',
15
+ gc_branch: gcBranch,
16
+ doc_count: status.doc_count,
17
+ indexed_doc_count: indexedDocCount,
18
+ docs,
19
+ warnings: status.warnings,
20
+ message: complete
21
+ ? `Onboarding is complete for gc-branch "${gcBranch}".`
22
+ : `Onboarding is incomplete for gc-branch "${gcBranch}". Docs or index entries are missing.`,
23
+ };
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsupmin/gc-tree",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Global Context Tree, a lightweight branch-aware global context orchestrator for AI coding tools",
5
5
  "type": "module",
6
6
  "private": false,
@@ -64,10 +64,12 @@ Use this when a user wants to create global context for a product, company, or w
64
64
  18. Ask for company/domain glossary terms and acronyms that should become durable context.
65
65
  19. Ask which verification commands should be treated as defaults for this gc-branch.
66
66
  20. Launch the guided onboarding flow with `gctree onboard [--branch <name>]`.
67
- 21. After the onboarding docs are written, explicitly list which durable docs were saved.
68
- 22. Summarize what you now understand from the saved docs instead of ending at the filenames alone.
69
- 23. Ask whether that final summary matches the user's reality, and capture any corrections before you wrap up.
70
- 24. Ask whether anything else should be saved while the context is still fresh.
71
- 25. Do not finish onboarding while material related repos, workflows, or domain terms remain uninspected when recoverable local evidence is still available.
72
- 26. Only after the related repos, workflows, glossary, and default verification commands are either captured or explicitly unavailable should you wrap up, then remind the user that future changes belong in `gctree update-global-context`.
73
- 27. Keep the current gc-branch explicit while gathering context.
67
+ 21. Before you claim onboarding is complete, run `gctree verify-onboarding --branch <current-gc-branch>` and inspect the real gc-tree files.
68
+ 22. Do not claim onboarding is complete unless verification returns `status: "complete"`.
69
+ 23. After the onboarding docs are written, explicitly list which durable docs were saved.
70
+ 24. Summarize what you now understand from the saved docs instead of ending at the filenames alone.
71
+ 25. Ask whether that final summary matches the user's reality, and capture any corrections before you wrap up.
72
+ 26. Ask whether anything else should be saved while the context is still fresh.
73
+ 27. Do not finish onboarding while material related repos, workflows, or domain terms remain uninspected when recoverable local evidence is still available.
74
+ 28. Only after the related repos, workflows, glossary, and default verification commands are either captured or explicitly unavailable should you wrap up, then remind the user that future changes belong in `gctree update-global-context`.
75
+ 29. Keep the current gc-branch explicit while gathering context.