Repository navigation
feat(mcp): layer team and project instructions over workspace guidance - #530
Pallavikumarimdb wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
a0f95e0 to
2a4773c
Compare
imshashank
left a comment
There was a problem hiding this comment.
The guidance composition and permission boundaries look good: resolved teams/projects use visibility-aware readers, the no-argument workspace response stays compatible, empty layers are omitted, and guidance remains advisory. All 138 existing focused core, MCP, validator, and UI tests pass.
One data-loss issue remains in both settings forms. They send unchanged instructions on unrelated saves, so renaming a project or editing a team description from an older tab overwrites guidance saved by another tab. Workspace guidance already protects this exact case with dirty-field omission and expected-instructions checks. Please carry that protection into the new layers and add a two-tab regression.
| body: { | ||
| name: draft.name, | ||
| summary: draft.summary, | ||
| instructions: instructions.trim(), |
There was a problem hiding this comment.
[P2] Omit unchanged guidance from unrelated settings saves
This field is sent on every save, including a rename when instructions were untouched. If another tab updated guidance after this form loaded, the rename silently restores the old text. team-settings-panel.tsx:65 has the same newly added unconditional field. I reproduced both payloads against the database. Workspace guidance already omits unchanged instructions and has explicit stale-tab tests, so the new layers lose an established protection for this feature. Track guidance dirtiness and omit it from unrelated PATCHes; mirror the expected-instructions contract for overlapping guidance edits. Add form tests proving a stale rename/description save preserves the newer instructions.
There was a problem hiding this comment.
This finding remains valid on this original head. The replacement #568 at 2a4ad75 omits untouched guidance on unrelated team/project saves and includes form regressions for those payloads, plus the server conflict contract for overlapping instruction edits. All six application CI jobs pass; its final isolated 42-migration full check is still pending. Keep this original PR unmerged until the reviewed replacement lands, then close it with contributor credit and a traceable link.
|
@Pallavikumarimdb checking in on this draft, nothing has been pushed since the 13th. The one open item: the project and team settings forms send unchanged instructions on every save. So a rename from an older tab silently restores guidance another tab changed ( |
|
@Pallavikumarimdb are you still working on this one? Nothing has changed since my last note on the 21st. If you've moved on, that's totally fine, just let me know and I'll close it for now. It can be reopened any time. |
|
Rechecked unchanged head |
|
The replacement preserving this contribution has now landed in #568, normal squash commit 39af4cf. It resolves the original instruction identity/policy and released-migration-history blockers, with PallaviKumari credited. Canonical full verification passed 7,387 tests with zero failures/skips; all fresh CI and the normal READY schema-guarded preview passed. Production schema is verified through 0041. The feature code is merged and awaits the final production build promotion. Closing this superseded PR while preserving its findings and history. Thank you for the original implementation. |
Current integration continues in #568, preserving this PR's contribution history. The replacement fixes untouched stale instruction overwrites, uses the explicit OAuth Agent identity, and replaces the conflicting independent 0030 migration with append-only 0038 after #564, #562, #565, #566 and provider #567. This original head remains unchanged until its replacement merges.
Use #568 for current source, validation, dependency and rollout status. Its final combined full verification and staged prerequisites remain pending. The original description below is historical and is not an operational release instruction.
What this changes
Adds configurable agent instructions to teams and projects, layers them under Markdown headings (
## Workspace,## Team,## Project) inget_workspace_instructions, and automatically attaches resolved instructions inget_issueresponses when called by an agent principal.Why
Teams and projects have distinct conventions such as branch naming rules, definitions of done, and labeling guidelines. Agents executing work in a team or project context need layered instructions that extend workspace-level guidance.
Closes #409
How you know it works
packages/shared/tests/validators/validators.test.tscovering length constraints up to 4000 characters.packages/core/tests/org/team-service.test.tsandpackages/core/tests/work/project-service.test.ts.packages/mcp-server/tests/instructions.test.tscovering Markdown heading composition, whitespace trimming, and omission of empty layers.get_workspace_instructionswithout parameters preserves verbatim workspace guidance for backward compatibility.get_workspace_instructionswith team/project resolves and layers Markdown headings.get_issuereturns resolved instructions whenprincipal.isAgent === trueand omits them for human callers.biome check .,check-comments,check-bytes,check-bun-imports,check-deps,typecheck, anddb:check-drift.Checklist
bun run verifyis green, all four checksany, no non-null assertions@orbit/sharedpackages/shared/src/policy, not only in the UIbun run db:releaseandbun run db:check-driftpassed against the target database before this shipsAnything reviewers should know
get_workspace_instructionswithout specifyingteamorprojectarguments retains the existing behavior and returns the raw workspaceagentInstructionsverbatim without heading prefixes.isAgentproperty is sourced fromschema.member.isAgentand exposed onPrincipalsoget_issueonly evaluates and returns instructions for agent principals, preserving compact payloads for human callers.