@lifeaitools/rdc-skills 0.20.2 → 0.20.3

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdc",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code — plan, build, review, overnight unattended builds with work-item tracking and TDD enforcement.",
5
5
  "author": {
6
6
  "name": "LIFEAI",
@@ -39,6 +39,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
39
39
  import fs from 'node:fs';
40
40
  import path from 'node:path';
41
41
  import { fileURLToPath } from 'node:url';
42
+ import { execFileSync } from 'node:child_process';
42
43
 
43
44
  import {
44
45
  listSkills,
@@ -62,6 +63,29 @@ function pkgVersion() {
62
63
  }
63
64
  }
64
65
 
66
+ // Commit the running process actually LOADED — resolved ONCE at startup, never
67
+ // per-request, so /health reports a PROVABLE commit. Resolution order:
68
+ // 1. git-sha.json — baked at pack/publish (scripts/stamp-git-sha.mjs). This is
69
+ // the PRODUCTION path: the process runs from the npm install (no .git), so
70
+ // runtime rev-parse can't work — the stamped file is the source of truth.
71
+ // 2. runtime `git rev-parse` — the DEV path (running straight from the checkout).
72
+ // 3. env override, then 'unknown'.
73
+ const GIT_SHA = (() => {
74
+ try {
75
+ const stamped = JSON.parse(fs.readFileSync(path.join(REPO_ROOT, 'git-sha.json'), 'utf8')).sha;
76
+ if (stamped && stamped !== 'unknown') return stamped;
77
+ } catch { /* not stamped — fall through to runtime/dev resolution */ }
78
+ try {
79
+ return execFileSync('git', ['rev-parse', 'HEAD'], {
80
+ cwd: REPO_ROOT,
81
+ encoding: 'utf8',
82
+ stdio: ['ignore', 'pipe', 'ignore'],
83
+ }).trim();
84
+ } catch {
85
+ return process.env.RDC_SKILLS_GIT_SHA || 'unknown';
86
+ }
87
+ })();
88
+
65
89
  // Soft process-wide default variant, updated whenever a client initializes.
66
90
  let lastDetectedVariant = 'cloud';
67
91
 
@@ -188,7 +212,7 @@ function startHttp() {
188
212
  } catch {
189
213
  skills = 0;
190
214
  }
191
- res.json({ status: 'ok', service: 'rdc-skills-mcp', version: pkgVersion(), skills });
215
+ res.json({ status: 'ok', service: 'rdc-skills-mcp', version: pkgVersion(), git_sha: GIT_SHA, skills });
192
216
  });
193
217
 
194
218
  // Block OAuth discovery so connectors skip OAuth and connect direct — /mcp is open.
package/git-sha.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "sha": "9116bba71645a39735855cd9d8de292023f16496"
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/rdc-skills",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code - plan, build, review, overnight builds",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -38,7 +38,7 @@
38
38
  "test:mcp:remote": "node tests/mcp.test.mjs --remote",
39
39
  "mcp": "node bin/rdc-skills-mcp.mjs",
40
40
  "rebuild-mcp": "node scripts/rebuild-mcp.mjs",
41
- "prepack": "node scripts/validate-publish-manifests.js --mode warn || true && node scripts/validate-place-histories.js --mode warn || true"
41
+ "prepack": "node scripts/validate-publish-manifests.js --mode warn || true && node scripts/validate-place-histories.js --mode warn || true && node scripts/stamp-git-sha.mjs"
42
42
  },
43
43
  "dependencies": {
44
44
  "@modelcontextprotocol/sdk": "^1.29.0",
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * stamp-git-sha.mjs — bake the current git HEAD into git-sha.json at pack/publish
4
+ * time. The MCP server runs from the npm-installed copy (no .git), so it cannot
5
+ * `git rev-parse` at runtime; this build-time stamp is how /health reports a
6
+ * PROVABLE commit ("running artifact == this exact published commit"). Run from
7
+ * `prepack`, so `npm pack`/`npm publish` (incl. the publish.yml CI job at the
8
+ * tagged commit) embeds the right SHA. Never fails the build — writes 'unknown'
9
+ * if git is unavailable (e.g. a tarball-only checkout).
10
+ */
11
+ import { execFileSync } from 'node:child_process';
12
+ import { writeFileSync } from 'node:fs';
13
+ import path from 'node:path';
14
+ import { fileURLToPath } from 'node:url';
15
+
16
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
17
+ let sha = 'unknown';
18
+ try {
19
+ sha = execFileSync('git', ['rev-parse', 'HEAD'], {
20
+ cwd: root,
21
+ encoding: 'utf8',
22
+ stdio: ['ignore', 'pipe', 'ignore'],
23
+ }).trim();
24
+ } catch {
25
+ sha = process.env.RDC_SKILLS_GIT_SHA || 'unknown';
26
+ }
27
+ const out = path.join(root, 'git-sha.json');
28
+ writeFileSync(out, JSON.stringify({ sha }, null, 2) + '\n');
29
+ console.error(`[stamp-git-sha] wrote ${out} sha=${sha}`);