Skip to content

chore: remove dead templates/ build toolchain and orphaned cdmq scripts - #209

Merged
k-rister merged 3 commits into
masterfrom
cleanup-dead-templates-toolchain
Aug 20, 2026
Merged

chore: remove dead templates/ build toolchain and orphaned cdmq scripts#209
k-rister merged 3 commits into
masterfrom
cleanup-dead-templates-toolchain

Conversation

@k-rister

@k-rister k-rister commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes the templates/*.base + build.sh/Makefile/init.sh/create-*-cmds.sh OpenSearch template-generation toolchain. queries/cdmq/cdm.js's indexDefs object is the actual live schema definition — used by every real indexing run via add-run.js, which validates document fields against it before ever reaching OpenSearch. The templates/ toolchain has zero live callers.
  • Removes queries/cdmq/create-index.js and get-instances-info.js (no wrapper script, no README mention, no CI reference — start-server.sh already handles index creation on its own) and setup.sh (a documented-but-unused manual convenience; both CI and start-server.sh install dependencies directly via npm ci/npm install).
  • Keeps templates/delete.sh, which is genuinely live — invoked by crucible's reinit_opensearch() in bin/base.
  • No behavior change. This is pure dead-code removal, confirmed via exhaustive grep -rn across this repo, crucible's bin/, .github/workflows/, and every other subproject in the org for each filename before deletion.
  • Second commit rewrites templates/README.md and this repo's CLAUDE.md Templates section, which described the removed toolchain as the current setup process — both now point at cdm.js's indexDefs as the real schema source and describe templates/ as containing only delete.sh. Bundled into this PR (rather than deferred) so the deletion and the docs describing it land atomically, with no window where merged docs describe commands that no longer exist. A handful of other pre-existing, unrelated stale-doc findings from the same audit (a false Prettier-CI-enforcement claim, missing web-ui routes, stale aggregation methodology docs) are NOT part of this PR — they're independent of this deletion and will be a separate follow-up.

Test plan

  • node --check on every remaining .js file in queries/cdmq/ — all pass
  • Verified zero require()/reference to the removed .js files anywhere in the repo
  • package.json has no script entries referencing any removed file
  • Confirmed templates/delete.sh is unaffected and still self-contained (no dependency on any removed file)

🤖 Generated with Claude Code

templates/*.base + build.sh/Makefile/init.sh/create-*-cmds.sh formed an
OpenSearch template/index-creation toolchain that queries/cdmq/cdm.js's
indexDefs (the actual live schema, used by every real indexing run via
add-run.js) fully superseded. Confirmed via exhaustive grep across this
repo, crucible's bin/, and every other subproject: zero live references
except templates/delete.sh, which stays (used by crucible's
reinit_opensearch()).

queries/cdmq/create-index.js and get-instances-info.js are likewise
unreferenced (no wrapper script, no README mention, no CI usage) --
superseded by start-server.sh's own index-creation path. setup.sh is
a documented-but-unused manual convenience; CI and start-server.sh
both install dependencies directly via npm.

No behavior change -- these files were not invoked by any script,
CI workflow, or documented workflow.
@k-rister
k-rister requested a review from a team August 19, 2026 16:59
@k-rister k-rister self-assigned this Aug 19, 2026
@project-crucible-tracking project-crucible-tracking Bot moved this to In Progress in Crucible Tracking Aug 19, 2026
templates/README.md and CLAUDE.md's Templates section described the
build.sh/Makefile/init.sh/create-*-cmds.sh toolchain deleted in the
previous commit as if it were still the current setup process. Point
both at queries/cdmq/cdm.js's indexDefs, the actual live schema
source, and describe templates/ as containing only delete.sh going
forward.
@k-rister

Copy link
Copy Markdown
Contributor Author

PR Review: CommonDataModel#209 — chore: remove dead templates/ build toolchain and orphaned cdmq scripts

Summary: Removes the obsolete OpenSearch index template-generation toolchain and unreferenced cdmq JavaScript utility scripts, centralizing the schema definition in the live query library (cdm.js).
Changed files: 22
Review dimensions: Correctness, API & Contracts, Build & Deploy, Documentation, Style, Completeness

Documentation

  • queries/cdmq/README.md#L8 — Stale instructions referencing the deleted ./setup.sh manual installation script.
  • queries/cdmq/README.md#L13 — Stale link and statement indicating that the Common Data Format is documented under the templates/ directory. Mappings are now defined in queries/cdmq/cdm.js's indexDefs object.
  • README.md#L10 — Stale reference listing "OpenSearch index templates" under "What This Project Includes".
  • README.md#L16-L17 — Stale description of the templates/ directory claiming it houses index templates, init.sh, and build.sh, which have all been removed.

File Coverage

  • CLAUDE.md — No issues found
  • templates/README.md — No issues found
  • queries/cdmq/create-index.js (deleted) — No issues found
  • queries/cdmq/get-instances-info.js (deleted) — No issues found
  • queries/cdmq/setup.sh (deleted) — No issues found
  • templates/Makefile (deleted) — No issues found
  • templates/build.sh (deleted) — No issues found
  • templates/config_cpu_vulnerabilities.base (deleted) — No issues found
  • templates/config_yum_repos.base (deleted) — No issues found
  • templates/create-cleanup-cmds.sh (deleted) — No issues found
  • templates/create-indices-cmds.sh (deleted) — No issues found
  • templates/create-template-cmds.sh (deleted) — No issues found
  • templates/init.sh (deleted) — No issues found
  • templates/iteration.base (deleted) — No issues found
  • templates/metric_data.base (deleted) — No issues found
  • templates/metric_desc.base (deleted) — No issues found
  • templates/param.base (deleted) — No issues found
  • templates/period.base (deleted) — No issues found
  • templates/run.base (deleted) — No issues found
  • templates/run_micro.base (deleted) — No issues found
  • templates/sample.base (deleted) — No issues found
  • templates/tag.base (deleted) — No issues found

Missing from diff:

  • queries/cdmq/README.md — Stale documentation references to setup.sh and the old templates/ layout should be updated or removed.
  • README.md — Stale references to OpenSearch index templates and obsolete scripts in ./templates should be updated or removed.

Limitations

This review was conducted statically. It does not verify runtime behaviors on a live OpenSearch instance or direct interactions with external running Crucible harness nodes. However, exhaustive static analysis confirms zero active callers or dependencies on any of the removed files.

Verdict

Approve with comments — The PR is functional, clean, and completely safe to merge since all deleted scripts have been verified to have zero active callers or dependencies in the organization. The stale documentation references identified above are non-blocking but should be addressed in a follow-up commit or pull request.

README.md and queries/cdmq/README.md still described OpenSearch index
templates and ./setup.sh as current, both removed in this PR. Point
readers at cdm.js's indexDefs and npm install instead.
@k-rister

Copy link
Copy Markdown
Contributor Author

Thanks for catching these — fixed in commit b0cd434:

  • queries/cdmq/README.md: replaced the ./setup.sh install instruction with npm install, and pointed the Common Data Format reference at cdm.js's indexDefs instead of the now-nonexistent templates/ documentation.
  • Top-level README.md: updated "What This Project Includes" and the ./templates directory-layout entry to describe delete.sh + cdm.js's indexDefs, instead of the removed OpenSearch index templates.

Same rationale as the templates/README.md/CLAUDE.md fix already in this PR: these two files are directly invalidated by this PR's own deletion, so fixing them here avoids a window where merged docs describe removed commands.

@atheurer atheurer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Clean removal of obsolete templates and cdmq scripts while preserving delete.sh and updating documentation to point to cdm.js as the single source of truth.

@k-rister
k-rister merged commit f027f50 into master Aug 20, 2026
37 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Crucible Tracking Aug 20, 2026
@k-rister
k-rister deleted the cleanup-dead-templates-toolchain branch August 20, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants