Skip to content

feat(ts-engine): implement registry_json so hm pipelines supports TypeScript-only repos#128

Merged
markovejnovic merged 5 commits into
mainfrom
relprep/1-feat-ts-engine-implement-registry-json
Jun 10, 2026
Merged

feat(ts-engine): implement registry_json so hm pipelines supports TypeScript-only repos#128
markovejnovic merged 5 commits into
mainfrom
relprep/1-feat-ts-engine-implement-registry-json

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

Summary

Implements registry_json in the TypeScript DSL engine so hm pipelines
supports TypeScript-only repos. The language resolver (detect.rs) now routes
both local hm run and cloud discovery (hm pipelines / hm render) through a
single detect_language that rejects ambiguous (.py + .ts) .hm/
directories rather than silently tie-breaking, keeping local and cloud builds in
lockstep.

Review findings addressed

  • Broken intra-doc link regression (judge blocking issue): the rustdoc on
    has_pipeline_files in crates/hm-dsl-engine/src/detect.rs linked to
    detect_language_python_first, which this PR deleted. That made
    cargo doc -p hm-dsl-engine --no-deps --document-private-items fail under
    RUSTDOCFLAGS=-D warnings (and would break docs.rs). Fixed by repointing the
    link to the surviving detect_language.

Verification

Command Result
RUSTDOCFLAGS="-D warnings" cargo doc -p hm-dsl-engine --no-deps --document-private-items PASS — Generated target/doc/hm_dsl_engine/index.html, no warnings
grep -rn "detect_language_python_first" --include="*.rs" . No matches (no stale references remain)

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). 🤖

markovejnovic and others added 4 commits June 10, 2026 18:39
…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
@markovejnovic markovejnovic merged commit af38e87 into main Jun 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant