@jagilber-org/index-server 1.27.0 → 1.28.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 +63 -1
- package/CONTRIBUTING.md +3 -3
- package/dist/dashboard/client/admin.html +58 -28
- package/dist/dashboard/client/css/admin.css +54 -0
- package/dist/dashboard/client/js/admin.config.js +3 -6
- package/dist/dashboard/client/js/admin.embeddings.js +63 -4
- package/dist/dashboard/client/js/admin.events.js +256 -0
- package/dist/dashboard/client/js/admin.feedback.js +1 -1
- package/dist/dashboard/client/js/admin.instructions.js +1 -1
- package/dist/dashboard/client/js/admin.maintenance.js +75 -32
- package/dist/dashboard/client/js/admin.sessions.js +1 -1
- package/dist/dashboard/security/SecurityMonitor.js +2 -2
- package/dist/dashboard/server/AdminPanel.js +83 -6
- package/dist/dashboard/server/AdminPanelConfig.d.ts +11 -0
- package/dist/dashboard/server/AdminPanelConfig.js +47 -17
- package/dist/dashboard/server/AdminPanelState.js +5 -1
- package/dist/dashboard/server/ApiRoutes.js +2 -1
- package/dist/dashboard/server/DashboardServer.js +13 -0
- package/dist/dashboard/server/MetricsCollector.js +3 -2
- package/dist/dashboard/server/WebSocketManager.js +2 -2
- package/dist/dashboard/server/middleware/ensureLoadedMiddleware.d.ts +1 -1
- package/dist/dashboard/server/middleware/ensureLoadedMiddleware.js +1 -1
- package/dist/dashboard/server/routes/admin.routes.js +143 -17
- package/dist/dashboard/server/routes/api.usage.routes.js +5 -1
- package/dist/dashboard/server/routes/embeddings.routes.js +91 -1
- package/dist/dashboard/server/routes/instructions.routes.js +142 -12
- package/dist/dashboard/server/routes/scripts.routes.js +1 -1
- package/dist/dashboard/server/routes/sqlite.routes.js +74 -0
- package/dist/models/instruction.d.ts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/server/sdkServer.js +12 -4
- package/dist/services/auditLog.d.ts +1 -1
- package/dist/services/auditLog.js +1 -1
- package/dist/services/embeddingService.d.ts +2 -0
- package/dist/services/embeddingService.js +16 -4
- package/dist/services/embeddingTrigger.d.ts +33 -0
- package/dist/services/embeddingTrigger.js +86 -0
- package/dist/services/eventBuffer.d.ts +45 -0
- package/dist/services/eventBuffer.js +110 -0
- package/dist/services/feedbackStorage.js +1 -1
- package/dist/services/handlers/instructions.add.js +36 -3
- package/dist/services/handlers/instructions.import.js +71 -13
- package/dist/services/handlers.dashboardConfig.js +81 -0
- package/dist/services/handlers.feedback.js +1 -1
- package/dist/services/handlers.instructionSchema.js +4 -4
- package/dist/services/handlers.search.js +3 -3
- package/dist/services/indexContext.d.ts +18 -0
- package/dist/services/indexContext.js +133 -24
- package/dist/services/instructionRecordValidation.d.ts +3 -0
- package/dist/services/instructionRecordValidation.js +64 -4
- package/dist/services/logger.js +9 -0
- package/dist/services/manifestManager.js +11 -1
- package/dist/services/seedBootstrap.js +7 -3
- package/dist/services/storage/factory.d.ts +2 -0
- package/dist/services/storage/factory.js +12 -1
- package/dist/services/toolRegistry.js +8 -8
- package/dist/services/toolRegistry.zod.js +3 -3
- package/dist/services/tracing.js +3 -1
- package/dist/versioning/schemaVersion.d.ts +1 -1
- package/dist/versioning/schemaVersion.js +47 -2
- package/package.json +54 -40
- package/schemas/index-server.code-schema.json +1 -1
- package/schemas/instruction.schema.json +3 -3
- package/schemas/json-schema/instruction-content-type.schema.json +1 -1
- package/schemas/json-schema/instruction-instruction-entry.schema.json +1 -1
- package/scripts/README.md +48 -0
- package/scripts/{generate-certs.mjs → build/generate-certs.mjs} +1 -1
- package/scripts/{setup-wizard.mjs → build/setup-wizard.mjs} +1 -1
- package/scripts/{setup-hooks.cjs → hooks/setup-hooks.cjs} +3 -3
- package/server.json +3 -3
- /package/scripts/{copy-dashboard-assets.mjs → build/copy-dashboard-assets.mjs} +0 -0
|
@@ -6,7 +6,7 @@ exports.migrateInstructionRecord = migrateInstructionRecord;
|
|
|
6
6
|
// Bump this when making a backward-incompatible on-disk schema change that
|
|
7
7
|
// requires a migration rewrite. Migration logic should detect older versions
|
|
8
8
|
// and transform + persist them once.
|
|
9
|
-
exports.SCHEMA_VERSION = '
|
|
9
|
+
exports.SCHEMA_VERSION = '5';
|
|
10
10
|
// Helper function for review interval computation (matches ClassificationService logic)
|
|
11
11
|
function computeReviewIntervalDays(tier, requirement) {
|
|
12
12
|
// Shorter intervals for higher criticality
|
|
@@ -57,6 +57,14 @@ function migrateInstructionRecord(rec) {
|
|
|
57
57
|
// no-op: optional metadata fields are already valid if present
|
|
58
58
|
notes.push('v3→v4: added optional metadata fields to schema');
|
|
59
59
|
}
|
|
60
|
+
// v4 → v5 migration: public persisted contentType "chat-session" was renamed
|
|
61
|
+
// to "workflow". Preserve the workflow/runbook semantics instead of falling
|
|
62
|
+
// through the generic invalid-enum fallback to "instruction".
|
|
63
|
+
if (prevVersion === '4' && rec.contentType === 'chat-session') {
|
|
64
|
+
rec.contentType = 'workflow';
|
|
65
|
+
changed = true;
|
|
66
|
+
notes.push('v4→v5: migrated legacy contentType "chat-session" to "workflow"');
|
|
67
|
+
}
|
|
60
68
|
// Clean optional nullable fields that upstream tools may emit as null
|
|
61
69
|
// (riskScore must be number or absent — null causes AJV rejection)
|
|
62
70
|
if ('riskScore' in rec && rec.riskScore === null) {
|
|
@@ -75,7 +83,7 @@ function migrateInstructionRecord(rec) {
|
|
|
75
83
|
categories: [],
|
|
76
84
|
priority: 50,
|
|
77
85
|
audience: 'all',
|
|
78
|
-
requirement: '
|
|
86
|
+
requirement: 'recommended'
|
|
79
87
|
};
|
|
80
88
|
for (const [key, defaultValue] of Object.entries(requiredDefaults)) {
|
|
81
89
|
if (!(key in rec) || rec[key] === undefined || rec[key] === null) {
|
|
@@ -84,6 +92,43 @@ function migrateInstructionRecord(rec) {
|
|
|
84
92
|
notes.push(`added required field ${key} with default value`);
|
|
85
93
|
}
|
|
86
94
|
}
|
|
95
|
+
// Validate and coerce enum fields to prevent invalid values from persisting.
|
|
96
|
+
// Legacy alias maps mirror indexLoader.ts coercion — try known aliases first,
|
|
97
|
+
// only fall back to defaults for truly unknown values. Keep in sync with indexLoader.ts.
|
|
98
|
+
const legacyStatusMap = { active: 'approved' };
|
|
99
|
+
const legacyAudienceMap = {
|
|
100
|
+
system: 'all', developers: 'group', developer: 'individual',
|
|
101
|
+
team: 'group', teams: 'group', users: 'group', dev: 'individual',
|
|
102
|
+
devs: 'group', testers: 'group', administrators: 'group',
|
|
103
|
+
admins: 'group', agents: 'group', 'powershell script authors': 'group',
|
|
104
|
+
};
|
|
105
|
+
const legacyRequirementMap = {
|
|
106
|
+
MUST: 'mandatory', SHOULD: 'recommended', MAY: 'optional',
|
|
107
|
+
CRITICAL: 'critical', OPTIONAL: 'optional', MANDATORY: 'mandatory',
|
|
108
|
+
DEPRECATED: 'deprecated', REQUIRED: 'mandatory',
|
|
109
|
+
};
|
|
110
|
+
const legacyContentTypeMap = {
|
|
111
|
+
'chat-session': 'workflow',
|
|
112
|
+
};
|
|
113
|
+
const enumDefaults = {
|
|
114
|
+
audience: { valid: ['individual', 'group', 'all'], fallback: 'all', legacy: legacyAudienceMap },
|
|
115
|
+
requirement: { valid: ['mandatory', 'critical', 'recommended', 'optional', 'deprecated'], fallback: 'optional', legacy: legacyRequirementMap },
|
|
116
|
+
contentType: { valid: ['instruction', 'template', 'workflow', 'reference', 'example', 'agent'], fallback: 'instruction', legacy: legacyContentTypeMap },
|
|
117
|
+
status: { valid: ['draft', 'review', 'approved', 'deprecated'], fallback: 'draft', legacy: legacyStatusMap },
|
|
118
|
+
priorityTier: { valid: ['P1', 'P2', 'P3', 'P4'], fallback: 'P3' },
|
|
119
|
+
classification: { valid: ['public', 'internal', 'restricted'], fallback: 'internal' },
|
|
120
|
+
};
|
|
121
|
+
for (const [field, { valid, fallback, legacy }] of Object.entries(enumDefaults)) {
|
|
122
|
+
if (typeof rec[field] === 'string' && !valid.includes(rec[field])) {
|
|
123
|
+
const val = rec[field];
|
|
124
|
+
// Try legacy alias maps (exact match then case-insensitive) before falling back to default
|
|
125
|
+
const resolved = legacy?.[val] ?? legacy?.[val.toLowerCase()] ?? legacy?.[val.toUpperCase()];
|
|
126
|
+
const target = resolved ?? (field === 'requirement' && /\s/.test(val) && val.length < 300 ? 'recommended' : fallback);
|
|
127
|
+
notes.push(`corrected invalid ${field} "${val}" → "${target}"`);
|
|
128
|
+
rec[field] = target;
|
|
129
|
+
changed = true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
87
132
|
// Update schema version if changed
|
|
88
133
|
if (rec.schemaVersion !== exports.SCHEMA_VERSION) {
|
|
89
134
|
rec.schemaVersion = exports.SCHEMA_VERSION;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jagilber-org/index-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"mcpName": "io.github.jagilber-org/index-server",
|
|
5
|
-
"description": "MCP instruction indexing server
|
|
5
|
+
"description": "MCP instruction indexing server with search, CRUD, validation, and cross-repo knowledge promotion.",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|
|
8
8
|
"access": "public"
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"!dist/tests/",
|
|
17
17
|
"schemas/",
|
|
18
18
|
"templates/",
|
|
19
|
-
"scripts/copy-dashboard-assets.mjs",
|
|
20
|
-
"scripts/setup-hooks.cjs",
|
|
21
|
-
"scripts/generate-certs.mjs",
|
|
22
|
-
"scripts/setup-wizard.mjs",
|
|
19
|
+
"scripts/build/copy-dashboard-assets.mjs",
|
|
20
|
+
"scripts/hooks/setup-hooks.cjs",
|
|
21
|
+
"scripts/build/generate-certs.mjs",
|
|
22
|
+
"scripts/build/setup-wizard.mjs",
|
|
23
23
|
"server.json",
|
|
24
24
|
"README.md",
|
|
25
25
|
"LICENSE",
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"index-server": "dist/server/index-server.js"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"setup": "node scripts/setup-wizard.mjs",
|
|
37
|
-
"instructions:normalize": "node scripts/normalize-instructions.js",
|
|
38
|
-
"build": "tsc -p tsconfig.json && node scripts/copy-dashboard-assets.mjs",
|
|
36
|
+
"setup": "node scripts/build/setup-wizard.mjs",
|
|
37
|
+
"instructions:normalize": "node scripts/migration/normalize-instructions.js",
|
|
38
|
+
"build": "tsc -p tsconfig.json && node scripts/build/copy-dashboard-assets.mjs",
|
|
39
39
|
"start": "node dist/server/index-server.js",
|
|
40
40
|
"start-minimal": "node dist/minimal/index.js",
|
|
41
41
|
"prestart": "npm run build",
|
|
42
|
-
"pretest": "node scripts/pretest-build-or-skip.mjs",
|
|
42
|
+
"pretest": "node scripts/testing/pretest-build-or-skip.mjs",
|
|
43
43
|
"dev": "cross-env NODE_ENV=development node --watch dist/server/index-server.js",
|
|
44
44
|
"build:watch": "tsc -w -p tsconfig.json",
|
|
45
45
|
"check:dist": "npm run build && git diff --quiet --exit-code dist || (echo 'Dist out of date. Run npm run build and commit generated files.' && exit 1)",
|
|
46
46
|
"coverage": "vitest run --coverage",
|
|
47
47
|
"sbom": "npx syft packages dir:. -o json > sbom.json || echo 'Syft not installed'",
|
|
48
48
|
"coverage:core": "cross-env FAST_COVERAGE=1 vitest run --coverage --reporter=dot --reporter=json",
|
|
49
|
-
"coverage:ci": "cross-env COVERAGE_HARD_MIN=50 COVERAGE_TARGET=60 npm run coverage:core && node scripts/coverage-alias.
|
|
50
|
-
"manifest:generate": "node scripts/generate-manifest.mjs",
|
|
51
|
-
"contract:tools": "node scripts/generate-tools-snapshot.mjs",
|
|
52
|
-
"verify:manifest": "node scripts/verify-manifest.mjs",
|
|
53
|
-
"check:version-parity": "node scripts/check-version-parity.mjs",
|
|
49
|
+
"coverage:ci": "cross-env COVERAGE_HARD_MIN=50 COVERAGE_TARGET=60 npm run coverage:core && node scripts/governance/coverage-alias.cjs && node scripts/governance/check-coverage.mjs",
|
|
50
|
+
"manifest:generate": "node scripts/build/generate-manifest.mjs",
|
|
51
|
+
"contract:tools": "node scripts/build/generate-tools-snapshot.mjs",
|
|
52
|
+
"verify:manifest": "node scripts/governance/verify-manifest.mjs",
|
|
53
|
+
"check:version-parity": "node scripts/governance/check-version-parity.mjs",
|
|
54
54
|
"test": "npm run test:fast",
|
|
55
55
|
"test:all": "vitest run",
|
|
56
56
|
"test:watch": "vitest",
|
|
@@ -61,43 +61,48 @@
|
|
|
61
61
|
"test:property": "vitest run src/tests/concurrencyFuzz.spec.ts",
|
|
62
62
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
63
63
|
"lint": "eslint .",
|
|
64
|
-
"lint:instructions": "node scripts/lint-instructions.mjs",
|
|
64
|
+
"lint:instructions": "node scripts/governance/lint-instructions.mjs",
|
|
65
|
+
"lint:logs": "node scripts/diagnostics/crawl-logs.mjs --dir logs --file test-results/test-output.log --allowlist .crawl-logs-allowlist --strict",
|
|
65
66
|
"format": "prettier --write .",
|
|
66
|
-
"prepare": "node scripts/setup-hooks.cjs",
|
|
67
|
+
"prepare": "node scripts/hooks/setup-hooks.cjs",
|
|
67
68
|
"audit": "npm audit --omit=dev --audit-level=high",
|
|
68
69
|
"prepublishOnly": "npm run build && npm run typecheck && npm run audit",
|
|
69
|
-
"scan:security": "node scripts/security-scan.mjs",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
70
|
+
"scan:security": "node scripts/governance/security-scan.mjs",
|
|
71
|
+
"publish:dry-run": "pwsh -NoProfile -File scripts/Invoke-ReleaseWorkflow.ps1 -DryRun",
|
|
72
|
+
"publish:prepare": "pwsh -NoProfile -File scripts/Invoke-ReleaseWorkflow.ps1",
|
|
73
|
+
"publish:create-pr": "pwsh -NoProfile -File scripts/Invoke-ReleaseWorkflow.ps1 -CreatePR",
|
|
74
|
+
"release:patch": "node scripts/build/bump-version.mjs patch",
|
|
75
|
+
"release:minor": "node scripts/build/bump-version.mjs minor",
|
|
76
|
+
"release:major": "node scripts/build/bump-version.mjs major",
|
|
73
77
|
"perf": "ts-node src/perf/benchmark.ts",
|
|
74
|
-
"perf:baseline": "npm run build && node scripts/perf-baseline.mjs",
|
|
75
|
-
"perf:drift": "npm run perf:baseline && node scripts/perf-compare.mjs",
|
|
76
|
-
"perf:trend": "node scripts/perf-trend.mjs",
|
|
77
|
-
"perf:summary": "node scripts/perf-summary-md.mjs",
|
|
78
|
+
"perf:baseline": "npm run build && node scripts/perf/perf-baseline.mjs",
|
|
79
|
+
"perf:drift": "npm run perf:baseline && node scripts/perf/perf-compare.mjs",
|
|
80
|
+
"perf:trend": "node scripts/perf/perf-trend.mjs",
|
|
81
|
+
"perf:summary": "node scripts/perf/perf-summary-md.mjs",
|
|
78
82
|
"perf:ci": "npm run perf:drift && npm run perf:trend && npm run perf:summary",
|
|
79
|
-
"guard:env": "ts-node scripts/enforce-config-usage.ts",
|
|
83
|
+
"guard:env": "ts-node scripts/governance/enforce-config-usage.ts",
|
|
80
84
|
"build:verify": "npm run typecheck && npm run build && npm run test:fast && npm run guard:env && npm run guard:decl",
|
|
81
85
|
"test:unit": "vitest run --config vitest.config.unit.ts",
|
|
82
86
|
"test:unit:watch": "vitest --config vitest.config.unit.ts",
|
|
83
|
-
"test:fast": "node scripts/test-fast.mjs",
|
|
84
|
-
"test:slow": "node scripts/test-slow.mjs",
|
|
85
|
-
"docs:tools": "node scripts/generate-tools-doc.
|
|
86
|
-
"health:check": "node scripts/health-check.mjs",
|
|
87
|
-
"guard:skips": "node scripts/check-no-skips.mjs",
|
|
88
|
-
"guard:baseline": "node scripts/guard-baseline.mjs",
|
|
89
|
-
"baseline:sentinel:update": "node scripts/baseline-sentinel.mjs update",
|
|
90
|
-
"baseline:sentinel:verify": "node scripts/baseline-sentinel.mjs verify",
|
|
91
|
-
"guard:decl": "node scripts/guard-declarations.mjs",
|
|
92
|
-
"guard:decl:fix": "node scripts/purge-extra-decls.mjs && node scripts/guard-declarations.mjs",
|
|
87
|
+
"test:fast": "node scripts/testing/test-fast.mjs",
|
|
88
|
+
"test:slow": "node scripts/testing/test-slow.mjs",
|
|
89
|
+
"docs:tools": "node scripts/build/generate-tools-doc.mjs",
|
|
90
|
+
"health:check": "node scripts/diagnostics/health-check.mjs",
|
|
91
|
+
"guard:skips": "node scripts/governance/check-no-skips.mjs",
|
|
92
|
+
"guard:baseline": "node scripts/governance/guard-baseline.mjs",
|
|
93
|
+
"baseline:sentinel:update": "node scripts/governance/baseline-sentinel.mjs update",
|
|
94
|
+
"baseline:sentinel:verify": "node scripts/governance/baseline-sentinel.mjs verify",
|
|
95
|
+
"guard:decl": "node scripts/governance/guard-declarations.mjs",
|
|
96
|
+
"guard:decl:fix": "node scripts/governance/purge-extra-decls.mjs && node scripts/governance/guard-declarations.mjs",
|
|
93
97
|
"pw:init": "npx playwright install --with-deps chromium firefox webkit",
|
|
94
98
|
"pw:test": "playwright test",
|
|
95
99
|
"playwright:start-server": "cross-env INDEX_SERVER_DASHBOARD=1 node dist/server/index-server.js",
|
|
96
|
-
"pw:baseline": "node scripts/run-playwright.mjs --grep @baseline --update",
|
|
97
|
-
"pw:drift": "node scripts/run-playwright.mjs --grep @baseline",
|
|
98
|
-
"pw:drift:report": "npm run pw:drift && node scripts/generate-drift-report.mjs",
|
|
100
|
+
"pw:baseline": "node scripts/testing/run-playwright.mjs --grep @baseline --update",
|
|
101
|
+
"pw:drift": "node scripts/testing/run-playwright.mjs --grep @baseline",
|
|
102
|
+
"pw:drift:report": "npm run pw:drift && node scripts/build/generate-drift-report.mjs",
|
|
99
103
|
"pw:drift:ci": "cross-env DRIFT_BROWSERS=chromium,firefox npm run pw:drift:report",
|
|
100
|
-
"
|
|
104
|
+
"pw:adversarial": "node scripts/testing/run-adversarial-tests.mjs",
|
|
105
|
+
"dash:seed": "node scripts/testing/seed-dashboard-fixtures.mjs"
|
|
101
106
|
},
|
|
102
107
|
"devDependencies": {
|
|
103
108
|
"@eslint/js": "^9.39.4",
|
|
@@ -134,6 +139,15 @@
|
|
|
134
139
|
"ws": "^8.19.0",
|
|
135
140
|
"zod": "^3.23.8"
|
|
136
141
|
},
|
|
142
|
+
"overrides": {
|
|
143
|
+
"mermaid": {
|
|
144
|
+
"uuid": "^14.0.0"
|
|
145
|
+
},
|
|
146
|
+
"@mermaid-js/layout-elk": {
|
|
147
|
+
"uuid": "^14.0.0"
|
|
148
|
+
},
|
|
149
|
+
"@types/express-serve-static-core": "5.0.7"
|
|
150
|
+
},
|
|
137
151
|
"optionalScripts": {},
|
|
138
152
|
"promptReviewCriteriaVersion": "1.0.0",
|
|
139
153
|
"license": "MIT",
|
|
@@ -23436,7 +23436,7 @@
|
|
|
23436
23436
|
{
|
|
23437
23437
|
"name": "ContentType",
|
|
23438
23438
|
"isExported": true,
|
|
23439
|
-
"type": "'instruction' | 'template' | '
|
|
23439
|
+
"type": "'instruction' | 'template' | 'workflow' | 'reference' | 'example' | 'agent'",
|
|
23440
23440
|
"line": 3
|
|
23441
23441
|
}
|
|
23442
23442
|
],
|
|
@@ -134,18 +134,18 @@
|
|
|
134
134
|
"enum": [
|
|
135
135
|
"instruction",
|
|
136
136
|
"template",
|
|
137
|
-
"
|
|
137
|
+
"workflow",
|
|
138
138
|
"reference",
|
|
139
139
|
"example",
|
|
140
140
|
"agent"
|
|
141
141
|
],
|
|
142
142
|
"default": "instruction",
|
|
143
|
-
"description": "Content type classification: instruction (actionable guidance), template (scaffolds/error templates),
|
|
143
|
+
"description": "Content type classification: instruction (actionable guidance), template (scaffolds/error templates), workflow (multi-step processes or runbooks), reference (docs/guides), example (code samples), agent (AI agent definitions/personas). The legacy value chat-session is accepted only by migration/write compatibility and is normalized to workflow before persistence; new records should use workflow."
|
|
144
144
|
},
|
|
145
145
|
"schemaVersion": {
|
|
146
146
|
"type": "string",
|
|
147
147
|
"enum": [
|
|
148
|
-
"
|
|
148
|
+
"5"
|
|
149
149
|
],
|
|
150
150
|
"description": "Internal schema version for migration"
|
|
151
151
|
},
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Scripts Directory
|
|
2
|
+
|
|
3
|
+
Organized by purpose. Each subdirectory has a clear role; naming conventions make intent obvious at a glance.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
| Directory | Purpose | Naming Convention |
|
|
8
|
+
|-----------|---------|-------------------|
|
|
9
|
+
| `build/` | Build, release, asset generation | `generate-*`, `copy-*`, `bump-*`, `build-*` |
|
|
10
|
+
| `ci/` | CI-specific runners and validation | — |
|
|
11
|
+
| `client/` | Client CLI tools and wizards | — |
|
|
12
|
+
| `deploy/` | Deployment and production ops | `deploy-*`, `smoke-*`, `prod-*` |
|
|
13
|
+
| `diagnostics/` | Adhoc probes, health checks, inspection | `adhoc-*` for one-off probes |
|
|
14
|
+
| `dist/` | Distributable scripts (shipped to users) | — |
|
|
15
|
+
| `governance/` | Guards, validators, lint, coverage | `guard-*`, `check-*`, `validate-*` |
|
|
16
|
+
| `hooks/` | Git hook implementations | `pre-commit*`, `pre-push*`, `commit-msg*` |
|
|
17
|
+
| `mappings/` | Configuration mappings | — |
|
|
18
|
+
| `migration/` | One-time data migrations (keep for history) | — |
|
|
19
|
+
| `perf/` | Performance baselines, trends, benchmarks | `perf-*`, `benchmark-*`, `stress-*` |
|
|
20
|
+
| `testing/` | Test runners, helpers, fixtures | `test-*`, `run-*`, `seed-*` |
|
|
21
|
+
|
|
22
|
+
## Naming Conventions
|
|
23
|
+
|
|
24
|
+
- **`adhoc-*`** — One-off diagnostic probes. Never referenced by CI or `package.json`. Safe to run manually during debugging; safe to delete when no longer needed.
|
|
25
|
+
- **`guard-*` / `check-*` / `validate-*`** — Governance gates. Referenced by package.json `guard:*` scripts or CI.
|
|
26
|
+
- **`generate-*`** — Code/doc/schema generators that produce artifacts.
|
|
27
|
+
- **`run-*`** — Wrappers that invoke test suites or tools with specific config.
|
|
28
|
+
|
|
29
|
+
## Adding New Scripts
|
|
30
|
+
|
|
31
|
+
1. **Pick the right directory** based on the table above.
|
|
32
|
+
2. **Use the naming convention** for that directory.
|
|
33
|
+
3. **Prefer `.mjs`** (ESM) over `.js`/`.cjs` for new scripts.
|
|
34
|
+
4. **If it's a one-off probe**, prefix with `adhoc-` and put in `diagnostics/`.
|
|
35
|
+
5. **If it needs to be referenced** from `package.json` or `.pre-commit-config.yaml`, note that in a comment at the top of the script.
|
|
36
|
+
|
|
37
|
+
## Migration Status
|
|
38
|
+
|
|
39
|
+
This reorg is in progress. Scripts are being moved category-by-category:
|
|
40
|
+
- [x] `diagnostics/` — adhoc probes, health checks
|
|
41
|
+
- [x] `hooks/` — git hook scripts
|
|
42
|
+
- [x] `client/` — client CLI tools
|
|
43
|
+
- [x] `build/` — build and release tools
|
|
44
|
+
- [x] `governance/` — guard and validation scripts
|
|
45
|
+
- [x] `perf/` — performance tools
|
|
46
|
+
- [x] `testing/` — test runners
|
|
47
|
+
- [x] `deploy/` — deployment scripts
|
|
48
|
+
- [x] `migration/` — one-time migrations
|
|
@@ -14,7 +14,7 @@ import path from 'path';
|
|
|
14
14
|
import { fileURLToPath } from 'url';
|
|
15
15
|
|
|
16
16
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const ROOT = path.resolve(__dirname, '..');
|
|
17
|
+
const ROOT = path.resolve(__dirname, '..', '..');
|
|
18
18
|
|
|
19
19
|
function parseArgs() {
|
|
20
20
|
const args = process.argv.slice(2);
|
|
@@ -25,7 +25,7 @@ import { fileURLToPath } from 'url';
|
|
|
25
25
|
import { select, input, confirm, checkbox } from '@inquirer/prompts';
|
|
26
26
|
|
|
27
27
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
-
const ROOT = path.resolve(__dirname, '..');
|
|
28
|
+
const ROOT = path.resolve(__dirname, '..', '..');
|
|
29
29
|
const IS_WINDOWS = process.platform === 'win32';
|
|
30
30
|
|
|
31
31
|
// --------------------------------------------------------------------------
|
|
@@ -8,19 +8,19 @@ function main(){
|
|
|
8
8
|
|
|
9
9
|
// Pre-commit hook — uses cross-platform Node.js script
|
|
10
10
|
const hookPath = join(hooksDir, 'pre-commit');
|
|
11
|
-
const content = `#!/usr/bin/env bash\n# Auto-generated pre-commit hook (cross-platform Node.js)\nnode ./scripts/pre-commit.mjs`;
|
|
11
|
+
const content = `#!/usr/bin/env bash\n# Auto-generated pre-commit hook (cross-platform Node.js)\nnode ./scripts/hooks/pre-commit.mjs`;
|
|
12
12
|
writeFileSync(hookPath, content, { encoding:'utf8' });
|
|
13
13
|
chmodSync(hookPath, 0o755);
|
|
14
14
|
|
|
15
15
|
// Commit-msg hook — uses cross-platform Node.js script
|
|
16
16
|
const commitMsgPath = join(hooksDir, 'commit-msg');
|
|
17
|
-
const commitMsgContent = `#!/usr/bin/env bash\n# Auto-generated commit-msg hook (cross-platform Node.js)\nnode ./scripts/commit-msg-baseline.mjs "$1"`;
|
|
17
|
+
const commitMsgContent = `#!/usr/bin/env bash\n# Auto-generated commit-msg hook (cross-platform Node.js)\nnode ./scripts/hooks/commit-msg-baseline.mjs "$1"`;
|
|
18
18
|
writeFileSync(commitMsgPath, commitMsgContent, { encoding:'utf8' });
|
|
19
19
|
chmodSync(commitMsgPath, 0o755);
|
|
20
20
|
|
|
21
21
|
// Pre-push hook enforces public-mirror protection.
|
|
22
22
|
const prePushPath = join(hooksDir, 'pre-push');
|
|
23
|
-
const prePushContent = `#!/usr/bin/env bash\n# Auto-generated pre-push hook (cross-platform Node.js)\nnode ./scripts/pre-push.mjs "$@"`;
|
|
23
|
+
const prePushContent = `#!/usr/bin/env bash\n# Auto-generated pre-push hook (cross-platform Node.js)\nnode ./scripts/hooks/pre-push.mjs "$@"`;
|
|
24
24
|
writeFileSync(prePushPath, prePushContent, { encoding:'utf8' });
|
|
25
25
|
chmodSync(prePushPath, 0o755);
|
|
26
26
|
}
|
package/server.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.jagilber-org/index-server",
|
|
4
|
-
"description": "MCP instruction indexing server
|
|
4
|
+
"description": "MCP instruction indexing server with search, CRUD, validation, and cross-repo knowledge promotion.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/jagilber-org/index-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.28.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@jagilber-org/index-server",
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.28.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|
|
File without changes
|