Skip to content

fix(discovery): ignore unrelated JSON type fields - #396

Merged
schickling merged 1 commit into
mainfrom
schickling-assistant/2026-08-30-fix-package-json-discovery
Aug 31, 2026
Merged

fix(discovery): ignore unrelated JSON type fields#396
schickling merged 1 commit into
mainfrom
schickling-assistant/2026-08-30-fix-package-json-discovery

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

Folder discovery treated any JSON type field as an Agent Spec marker. An ordinary ESM package.json with "type":"module" became a phantom agent and could receive st2 state inside the project directory.

Goal

Recognize a standalone type marker only for the supported Agent Spec value, while preserving validation for files with other agent-shaped markers.

Decisions

Narrow the existing candidate predicate instead of adding filename-specific exclusions. This keeps declaration classification semantic across JSON, TOML, and KDL.

Verification

  • CI=1 nix develop -c cargo test -p agent-spec only_service_type_is_a_spec_candidate_by_itself --lib — 1 passed
  • CI=1 nix develop -c cargo test --test validate type_batch_is_retired_and_flagged_unknown — 1 passed
  • nix flake check --print-build-logs --no-write-lock-file — passed all 16 Linux checks

Complexity

No new complexity. One predicate now checks the supported value rather than field presence.

Concerns

A file with another strong Agent Spec marker and an unknown type remains a candidate, so validation still reports the unknown type.

Friction & bottlenecks

Local Nix tracing emitted an ignored permissions warning. Validation itself passed.

Follow-ups

None.

References

Closes #247

Posted on behalf of @schickling
field value
agent_identity dev3.direct.omp.vjwqaz7t
session dev3.vjwqaz7t
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.11
agent_runtime OMP 18.0.11
tooling_profile dotfiles@000f2b3

agent-identity: dev3.direct.omp.vjwqaz7t
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.11
agent-runtime: OMP 18.0.11
tooling-profile: dotfiles@000f2b3
@schickling-assistant
schickling-assistant marked this pull request as ready for review August 30, 2026 23:18
@schickling
schickling merged commit efc69ea into main Aug 31, 2026
2 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.

Discovery admits any JSON with a top-level type key as an Agent Spec, so an ordinary {"type":"module"} package.json becomes a phantom agent

2 participants