Skip to content

feat: expose routing metadata in manifest - #62

Merged
pertrai1 merged 2 commits into
mainfrom
feat/manifest-routing-metadata
Jul 10, 2026
Merged

pertrai1 merged 2 commits into
mainfrom
feat/manifest-routing-metadata

Conversation

@pertrai1-bot

Copy link
Copy Markdown
Collaborator

Summary

  • Adds optional routing metadata to manifest entries so agents/tools can use manifest.json as a compact routing index.
  • Extracts existing frontmatter triggers/routing hints into generated manifest output.
  • Adds validation for optional routing metadata array shapes.

Verification

  • npm run check

Parallel PR notes

  • Part of the three-PR SkillWeaver-inspired split.
  • Independent from feat: add composite task routing eval #61 composite routing guidance and the selected-entry context audit PR.
  • Possible future follow-up: tune the exact routing metadata vocabulary after seeing how route-level audit consumes it.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@pertrai1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b01839ac-e74a-41e4-9f67-ac942f30cbe5

📥 Commits

Reviewing files that changed from the base of the PR and between c162eb4 and c607147.

📒 Files selected for processing (7)
  • README.md
  • manifest.json
  • scripts/frontmatter.ts
  • scripts/generate-manifest.ts
  • scripts/test-cli.ts
  • scripts/validate-directives.ts
  • src/manifest.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/manifest-routing-metadata

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the repo’s generated manifest.json so it can serve as a lightweight routing index for external tools/agents by including optional per-entry routing metadata derived from frontmatter.

Changes:

  • Add optional routing metadata to manifest entry types and emit it during manifest generation.
  • Introduce a shared frontmatter parser and validate optional routing-related frontmatter array shapes.
  • Document the new routing metadata in the README and regenerate manifest.json accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/manifest.ts Extends the runtime manifest types to include optional routing metadata.
scripts/validate-directives.ts Validates optional routing-related frontmatter keys/array shapes (including nested routing.*).
scripts/generate-manifest.ts Extracts routing metadata from frontmatter and writes it into manifest.json.
scripts/frontmatter.ts Adds a shared minimal frontmatter parser used by generation/validation scripts.
README.md Documents manifest.json as a compact routing index via optional routing metadata.
manifest.json Regenerated output showing populated routing fields for relevant entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/generate-manifest.ts Outdated
Comment on lines +65 to +83
function objectValue(value: unknown): Record<string, unknown> {
if (!value || Array.isArray(value) || typeof value !== 'object') return {};
return value as Record<string, unknown>;
}

function uniqueStrings(values: Array<string[] | undefined>): string[] | undefined {
const merged = values.flatMap((value) => value ?? []);
const unique = [...new Set(merged)];
return unique.length > 0 ? unique : undefined;
}

function readArray({ source, keys, path }: { source: Record<string, unknown>; keys: string[]; path: string }): string[] | undefined {
const values = keys.map((key) => optionalStringArray(source[key], { key, path }));
return uniqueStrings(values);
}

function buildRouting(fm: Record<string, unknown>, path: string): ManifestRouting | undefined {
const routingSource = objectValue(fm.routing);
const routing: ManifestRouting = {};
@pertrai1-bot

Copy link
Copy Markdown
Collaborator Author

Addressed review feedback in the latest commit.

Valid comment fixed:

  • Copilot was right that scripts/generate-manifest.ts silently dropped routing when frontmatter used a non-mapping value. Manifest generation now fails fast with a clear Invalid optional 'routing' ... expected a mapping error.

Regression coverage:

  • Added a test:cli case that temporarily injects routing: true into directive frontmatter and verifies scripts/generate-manifest.ts fails instead of silently dropping metadata.

Skipped:

  • CodeRabbit did not provide actionable review comments; it only reported the review limit.

Validation:

  • npm run test:cli
  • npm run check

@pertrai1
pertrai1 merged commit 97d0934 into main Jul 10, 2026
2 checks passed
@pertrai1
pertrai1 deleted the feat/manifest-routing-metadata branch July 10, 2026 13:22
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.

3 participants