Skip to content

feat(typescript): apply knowledge-base rules during Linear publication - #537

Open
kmbroai wants to merge 22 commits into
mainfrom
dev/kyleb/knowledge-based-linear-publication
Open

feat(typescript): apply knowledge-base rules during Linear publication#537
kmbroai wants to merge 22 commits into
mainfrom
dev/kyleb/knowledge-based-linear-publication

Conversation

@kmbroai

@kmbroai kmbroai commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add --knowledge-base PATH to publish scan so an organization can set Linear priority and existing labels with its own policy documents. Without this option, publication keeps the current severity-to-priority mapping and does not run policy evaluation.

How it works

  • Require a Linear API key and an existing Codex sign-in. Connected-app publication cannot use --knowledge-base.
  • Before creating any issue, validate the sealed scan, selected Linear team and project, and available team and workspace labels.
  • Read Markdown, text, PDF, or DOCX policy documents with the existing knowledge-base loader.
  • Run one ephemeral Codex turn with structured output. The turn uses the default Codex model, skips user configuration, and cannot access the network, use web search, or enable executable tool features. The Linear API key is removed from its environment.
  • Require one result for every finding. Reject unknown or duplicate findings, invalid priorities, unavailable labels, conflicting label groups, and policy errors before creating any issue.
  • Leave priority and labels unset when no policy rule matches. Do not fall back to the default severity mapping in knowledge-base mode.
  • Keep the Linear team, project, issue title and description, and assignee outside model control.

--dry-run --knowledge-base performs the same Linear reads and policy evaluation without creating issues. Publication results and private receipts include the resolved priority and label IDs and names. They do not store policy contents, policy file paths, model prompts, or credentials.

Testing

  • 143 focused Bun tests for publication enrichment, direct and connected-app publication, CLI behavior, and Linear validation
  • Full GitHub Actions matrix passed on macOS, Ubuntu, and Windows with the supported Node.js versions
  • Formatting, package inspection, installed-package smoke tests, and generated type checks passed in CI

Risk

Publication without --knowledge-base is unchanged. Knowledge-base publication depends on the model to interpret the supplied rules, but the CLI validates every result before the first Linear mutation. Labels must already exist in the selected Linear team or workspace. Once issue creation begins, the existing partial-failure behavior is unchanged.

Policy documents cannot change the Linear team, project, issue title or description, assignee, state, cycle, estimate, or due date.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@kmbroai kmbroai changed the title [typescript] add knowledge-based Linear publication feat(typescript): add knowledge-based Linear publication Aug 18, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Aug 18, 2026
@kmbroai kmbroai changed the title feat(typescript): add knowledge-based Linear publication feat(typescript): apply knowledge-base rules during Linear publication Aug 20, 2026
@kmbroai
kmbroai marked this pull request as ready for review August 20, 2026 06:29
@kmbroai

kmbroai commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-20T06:30:55.635297Z c313816 Manual request
🔒 Security Review Completed 2026-08-20T06:32:11.959311Z c313816 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c313816acb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/src/cli.ts
Comment on lines +1871 to +1872
knowledgeBase: z
.array(optionValue("--knowledge-base"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Namespace the Linear publication policy option

Because these documents control Linear-native priorities and label IDs and require a Linear API key, exposing them through the generic --knowledge-base flag gives an integration-specific field a destination-agnostic name. When another --to destination is added, that target cannot assign different knowledge-base semantics without a compatibility conflict; rename this flag to --linear-knowledge-base and align the corresponding option before publishing the interface.

AGENTS.md reference: sdk/typescript/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant