Skip to content

feat: add PR interest classifier schema#2

Merged
dutifulbob merged 1 commit into
mainfrom
feat/pr-classifier-interest-schema
May 19, 2026
Merged

feat: add PR interest classifier schema#2
dutifulbob merged 1 commit into
mainfrom
feat/pr-classifier-interest-schema

Conversation

@dutifulbob

Copy link
Copy Markdown
Member

Summary

Updates the PR classifier example to use the slimmer interest-based shape.
The schema now drops relevance, evidence, and metadata, and uses interest with i0 through i4 instead.
It also adds a reusable checked-in schema file so the workflow no longer depends on /tmp schemas.

What Changed

The localagent structured-output machinery is unchanged.
This only updates the reusable classifier contract and the docs/tests around it.

  • Added schemas/pr-local-model-classifier.schema.json.
  • Included schemas/** in the npm package files.
  • Updated docs and README examples to point at the checked-in schema.
  • Updated tests from relevance to interest.

Testing

I ran local checks and a real LM Studio/Gemma smoke test against the original PR-classification use case.

  • npm run check
  • node dist/src/cli/main.js --session-dir /tmp/localagent-smoke-interest-schema --final-schema schemas/pr-local-model-classifier.schema.json --tools bash -p "Read the PR contents before answering. Use gh to inspect https://github.com/openclaw/openclaw/pull/80568, including title, body, changed files, and enough diff/context to classify it. Classify whether this PR is about local models or not. Use interest i0 to i4, where i0 is highest interest and i4 is lowest interest. Return the final answer only by calling final_json." | tee /tmp/localagent-pr-80568-interest.json | jq -e '.is_local_model_related == true and (.interest | test("^i[0-4]$")) and (has("relevance") | not) and (has("evidence") | not) and (has("metadata") | not)'

The smoke output classified PR 80568 as local-model related with interest: "i0" and no relevance, evidence, or metadata fields.

Risks

This changes the example classifier schema shape, not localagent's generic schema feature.
Existing users with their own schema files are unaffected.

@dutifulbob

Copy link
Copy Markdown
Member Author

Final report:

  • Added schemas/pr-local-model-classifier.schema.json.
  • Removed relevance, evidence, and metadata from the classifier shape.
  • Added interest with enum i0 through i4.
  • Updated docs, README, package files, and tests.

Validation:

  • npm run check passed locally.
  • Real PR 80568 smoke test passed through localagent/Gemma.
  • The smoke output had interest: "i0" and no relevance, evidence, or metadata fields.
  • GitHub Actions ci / test passed.

@dutifulbob dutifulbob merged commit 46ac6c1 into main May 19, 2026
1 check passed
@dutifulbob dutifulbob deleted the feat/pr-classifier-interest-schema branch May 19, 2026 06:11
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