fix(qizheng): pin vendor bytes to local a911c890 checkout
Independent Staging Quality Gate / validate (push) Failing after 6m58s
Independent Staging Quality Gate / publish (push) Skipped

Re-copy LICENSE/README/package.json/cli.cjs from the local yinduzhanxing snapshot. Drop dist/index.cjs that was assembled from npm. Do not include 6c27aab6 or 8bba9cb5.
This commit is contained in:
jesse-ux
2026-09-15 16:33:31 +08:00
parent 830799fafb
commit f7386e0717
6 changed files with 19 additions and 46672 deletions
+9 -13
View File
@@ -69,15 +69,12 @@ def test_live_chart_matches_golden_and_product_contract() -> None:
assert "\\" not in raw or "[redacted-path]" in raw
def test_ketu_mode_request_overrides_and_is_echoed() -> None:
def test_ketu_mode_request_is_echoed_and_engine_mode_is_visible() -> None:
_require_node()
result = calculate_qizheng_chart({**SAMPLE, "ketu_mode": "descending-node"})
assert result["calculation"]["ketu_mode"] == "descending-node"
assert result["calculation"]["engine_ketu_mode"] == "descending-node"
rahu = result["bodies"]["rahu"]["siderealLon"]
ketu = result["bodies"]["ketu"]["siderealLon"]
separation = abs((ketu - rahu) % 360)
assert min(separation, 360 - separation) > 170
# a911c890 CLI has no ketuMode flag; actual school is the engine default.
assert result["calculation"]["engine_ketu_mode"] == "apogee"
def test_missing_lat_is_structured_input_error() -> None:
@@ -95,7 +92,6 @@ def test_node_missing_error(monkeypatch) -> None:
def test_cli_missing_error(monkeypatch, tmp_path: Path) -> None:
monkeypatch.setattr(engine, "VENDORED_CLI", tmp_path / "cli.cjs")
monkeypatch.setattr(engine, "VENDORED_LIB", tmp_path / "index.cjs")
monkeypatch.setattr(engine.shutil, "which", lambda name: "node")
with pytest.raises(engine.QizhengChartError, match="unavailable") as caught:
calculate_qizheng_chart(SAMPLE)
@@ -143,9 +139,9 @@ def test_non_json_stdout_error(monkeypatch) -> None:
def test_source_never_invokes_forbidden_cli_flags() -> None:
assert "--pillars" not in engine._NODE_EVAL
assert "--luck" not in engine._NODE_EVAL
assert "--seven-governors" not in engine._NODE_EVAL
assert "getSevenGovernorsChart" in engine._NODE_EVAL
argv = ["node", "-e", engine._NODE_EVAL]
assert not engine.FORBIDDEN_CLI_FLAGS.intersection(argv)
source = Path(engine.__file__).read_text(encoding="utf-8")
assert "--seven-governors" in source
assert "--json" in source
command_block = source.split("command = [", 1)[1].split("]", 1)[0]
for flag in engine.FORBIDDEN_CLI_FLAGS:
assert flag not in command_block