feat(ts-engine): implement registry_json so hm pipelines supports TypeScript-only repos#128
Merged
markovejnovic merged 5 commits intoJun 10, 2026
Conversation
…eScript-only repos `hm pipelines` (the command the backend shells out to for pipeline discovery) hard-failed for any TypeScript-only repo: SubprocessTsEngine:: registry_json bailed with "not yet supported for TypeScript pipelines". Run under `set -euo pipefail` as `cd /tmp/co && hm pipelines`, that non-zero exit was tagged as a user-code discovery failure, so a TS-only repo could never register a pipeline. (ts-discovery-bail-1) Add a third `registry` mode to the TS RUNNER_SCRIPT that emits the full discovery envelope already built via renderEnvelope — schema_version + pipelines[] with slug/name/allow_manual/triggers/definition — and wire registry_json to it. The envelope is byte-for-byte parity with Python's dump_registry_json(), so HarmontCore discovery parses TS and Python envelopes identically. A new test, typescript_registry_json_carries_ triggers_and_allow_manual, mirrors the Python parity test and locks the shape. `hm run` (detect_language) preferred TypeScript when both .py and .ts were present, while `hm pipelines`/`hm render` (detect_language_python_first) preferred Python — so a mixed-language repo ran one language locally and built the other in the cloud. Collapse the two divergent resolvers into a single detect_language that fails loudly on an ambiguous (both-files) repo (Rust/Elm-shaped diagnostic: points at the conflict, states the fix), and route render/pipelines through it too. Every shipped example carried both a redundant pipeline.py and pipeline.ts; drop the .ts duplicates so each example is the single-language Python repo its README already documents. (detect-run-vs-discovery-divergence-2)
…python_first Point the has_pipeline_files rustdoc link at the surviving detect_language; the referenced function was removed in this PR, breaking cargo doc --document-private-items under RUSTDOCFLAGS=-D warnings (and docs.rs).
…ine-implement-registry-json # Conflicts: # crates/hm-dsl-engine/src/detect.rs
…ine-implement-registry-json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
registry_jsonin the TypeScript DSL engine sohm pipelinessupports TypeScript-only repos. The language resolver (
detect.rs) now routesboth local
hm runand cloud discovery (hm pipelines/hm render) through asingle
detect_languagethat rejects ambiguous (.py+.ts).hm/directories rather than silently tie-breaking, keeping local and cloud builds in
lockstep.
Review findings addressed
has_pipeline_filesincrates/hm-dsl-engine/src/detect.rslinked todetect_language_python_first, which this PR deleted. That madecargo doc -p hm-dsl-engine --no-deps --document-private-itemsfail underRUSTDOCFLAGS=-D warnings(and would break docs.rs). Fixed by repointing thelink to the surviving
detect_language.Verification
RUSTDOCFLAGS="-D warnings" cargo doc -p hm-dsl-engine --no-deps --document-private-itemsGenerated target/doc/hm_dsl_engine/index.html, no warningsgrep -rn "detect_language_python_first" --include="*.rs" .The implementer's prior verification (cargo build + cargo clippy) passed but did
not exercise intra-doc links, which is why the regression was missed. The
re-run above is the decisive check for this finding.
Judge verdict
Not approved (1 blocking issue: broken intra-doc link). The blocking issue has
been fixed and re-verified in this PR.
Generated by the Harmont release-readiness workflow (automated; needs human review before merge). 🤖