Skip to content

fix(spaces): send the four pipeline config dicts create() requires - #24

Merged
MantisCartography merged 1 commit into
mainfrom
fix/create-configs
Sep 28, 2026
Merged

MantisCartography merged 1 commit into
mainfrom
fix/create-configs

Conversation

@MantisCartography

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #23 (visibility contract). Found while end-to-end verifying the fixed SDK payload against the live prod serializer: the visibility fix alone is NOT sufficient to un-break SDK space creation.

The backend's CreateMapSerializer (since the Synthesis abstraction change, MantisAPI #1780, Jul 11) hard-requires four pipeline config dicts in every /synthesis/landscape request — embedding_config, reduction_config, clustering_config, labeling_config. A request without them 400s with "This configuration object is required.". The SDK's create() sends none of them. (The repo_radar failure log only ever showed the is_public error because that check fires first in validate() — fixing is_public alone would have exposed the config 400 the very next run.)

Changes

  • create() now sends the four minimal self-defaulting config dicts, shapes verified against the production CreateMapSerializer inside the live Django container:
    • embedding_config: {method: llm, service: vllm-embeddings, model: auto, batch_size: 100}
    • reduction_config: {reduction_method: <reducer arg>, start_dimension: null, end_dimension: 2}
    • clustering_config: {clustering_method: k_means}
    • labeling_config: {config_type: metadata, service: vllm-instruct, model: auto}
  • All four are overridable via new kwargs (embedding_config=, reduction_config=, clustering_config=, labeling_config=).
  • from_github() is unaffected — the backend's GitHubRepoSerializer builds its own configs.
  • 2 new tests: all four configs present + dict-shaped; override kwarg respected.

Verification

  • Full SDK test suite: 80 passed.
  • End-to-end against prod: ran the EXACT multipart form the fixed create() builds (string values + the view's json.loads pass simulated) through the real CreateMapSerializer inside the prod Django container — [PASS] FULL fixed-SDK payload validates, visibility: unlisted lands in space_config, all four configs land in map_config.

Note for reviewers

The MantisAPI CI contract check (sdk_contract.check_contract) only validates routes/data-types — the live test_create_space_request_contract never runs in CI (the SDK is deliberately not importable in the CI venv), which is why this drift wasn't caught. Worth considering a CI lane that runs the live contract test with the SDK installed.

The backend's CreateMapSerializer (since the Synthesis abstraction change,
MantisAPI #1780) hard-requires embedding_config, reduction_config,
clustering_config and labeling_config as dicts in the /synthesis/landscape
request — a create without them 400s with 'This configuration object is
required.'

create() now sends the minimal self-defaulting shapes (verified against the
prod serializer inside the live container):
- embedding_config: {method: llm, service: vllm-embeddings, model: auto,
  batch_size: 100}
- reduction_config: {reduction_method: <reducer>, start_dimension: null,
  end_dimension: 2}
- clustering_config: {clustering_method: k_means}
- labeling_config: {config_type: metadata, service: vllm-instruct, model: auto}

All four are overridable via new kwargs (embedding_config=,
reduction_config=, clustering_config=, labeling_config=). from_github() is
unaffected — GitHubRepoSerializer builds its own configs.

Full payload verified end-to-end against the production CreateMapSerializer.
Test suite: 80 passed.
@MantisCartography
MantisCartography merged commit 7ddb2fc into main Sep 28, 2026
4 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