-
Notifications
You must be signed in to change notification settings - Fork 0
Stack Palantir engineering context into Zyra agents and copilot #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
40330e8
Add Zyra engineering fleet context
sonoxo 6ba6c94
Document Zyra Palantir engineering stack
sonoxo 7925bb1
Add Zyra engineering fleet skill
sonoxo d45a985
Test Zyra engineering fleet context
sonoxo 13dcba0
Run engineering fleet tests in Zyra CI
sonoxo 1a799b6
Wire Zyra LLM through engineering fleet context
sonoxo d928d6d
Bridge adaptive intelligence to engineering fleet
sonoxo dbf1849
Add engineering fleet to Zyra architecture skill
sonoxo 25a051f
Use token-aware engineering context matching
sonoxo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Zyra Engineering Fleet | ||
|
|
||
| Use this skill for data engineering, ontology, application development, AIP/LLM integration, release engineering, and cross-stack architecture work. | ||
|
|
||
| ## Clean-room knowledge sources | ||
|
|
||
| - Palantir Learn Data Engineer guide: https://learn.palantir.com/data-engineer-guide/1388785 | ||
| - Palantir Learn Application Developer guide: https://learn.palantir.com/application-developer-guide/1481796 | ||
| - Public Palantir Foundry documentation for pipelines, data expectations, ontology, application building, Workshop state/events, and AIP tool context. | ||
|
|
||
| Do not copy proprietary certification-guide text or claim Palantir affiliation, certification, tenant access, private APIs, or product internals. | ||
|
|
||
| ## Fleet roles | ||
|
|
||
| For complex missions, assign the smallest useful bounded role set: | ||
|
|
||
| 1. Intake — inspect sources, constraints, provenance, ownership, desired outcome. | ||
| 2. Pipeline — ingestion, normalization, transforms, data products, freshness. | ||
| 3. Quality — preconditions, postconditions, tests, integrity, failure policy. | ||
| 4. Ontology — canonical objects, properties, links, actions, semantic contracts. | ||
| 5. Application — lowest-complexity UI/workflow/API that satisfies the use case. | ||
| 6. Security — least privilege, secret handling, write boundaries, abuse cases. | ||
| 7. Release — CI, downstream impact, rollback, health, promotion evidence. | ||
| 8. Observer — lineage, evidence, unresolved risks, task status, completion proof. | ||
|
|
||
| ## Decision loop | ||
|
|
||
| `INSPECT -> MODEL -> PLAN -> DECOMPOSE -> EXECUTE -> VALIDATE -> OBSERVE -> REPAIR -> APPROVE -> RELEASE -> AUDIT` | ||
|
|
||
| Independent roles may work in parallel only when their dependencies are explicit. The runtime owns tools and permissions. Read access and write access must remain distinguishable. Consequential external writes, destructive changes, production promotion, credentials, and payment-related operations remain approval-gated by the surrounding system. | ||
|
|
||
| ## Data engineering rules | ||
|
|
||
| - Work backward from the operational ontology/workflow. | ||
| - Separate source cleanup, reusable transforms, canonical outputs, and consuming workflows. | ||
| - Treat published datasets as contracts with ownership, schema, provenance, freshness, and downstream consumers. | ||
| - Encode critical assumptions as executable quality checks and stop invalid data before it propagates. | ||
| - Prefer batch when it meets requirements; adopt incremental or streaming only when scale or latency justifies complexity. | ||
| - Include health, lineage, build evidence, incident ownership, and rollback in production design. | ||
|
|
||
| ## Application development rules | ||
|
|
||
| - Start from objects, links, properties, and governed actions before UI details. | ||
| - Treat components/widgets as explicit input/output units with typed state and events. | ||
| - Route domain mutations through governed actions, not arbitrary client-side writes. | ||
| - Give LLMs only the variables, objects, searches, functions, tools, applications, and actions needed for the workflow. | ||
| - Prefer the lowest-complexity surface that meets the use case; escalate to custom code only when justified. | ||
|
|
||
| ## Completion gate | ||
|
|
||
| Do not report completion until applicable tests, data expectations, security checks, downstream-impact checks, health checks, rollback readiness, and execution evidence are present. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Zyra Palantir Engineering Stack | ||
|
|
||
| Zyra uses a clean-room engineering knowledge layer derived from public Palantir Learn links supplied by the project owner and public Palantir Foundry documentation. It does not copy certification-guide text, proprietary code, private APIs, or Palantir product assets. | ||
|
|
||
| ## Source guides | ||
|
|
||
| - https://learn.palantir.com/data-engineer-guide/1388785 | ||
| - https://learn.palantir.com/application-developer-guide/1481796 | ||
|
|
||
| ## Stack | ||
|
|
||
| ```text | ||
| SOURCE / INTAKE | ||
| ↓ | ||
| PIPELINE | ||
| ↓ | ||
| QUALITY / DATA EXPECTATIONS | ||
| ↓ | ||
| ONTOLOGY | ||
| objects • properties • links • actions | ||
| ↓ | ||
| APPLICATION | ||
| state • variables • events • UI • APIs | ||
| ↓ | ||
| AIP / LLM | ||
| bounded context • tools • functions • governed actions | ||
| ↓ | ||
| SECURITY / APPROVAL | ||
| ↓ | ||
| RELEASE / HEALTH / LINEAGE / AUDIT | ||
| ``` | ||
|
|
||
| ## Agentic fleet | ||
|
|
||
| Zyra decomposes complex engineering work into bounded specialist roles: | ||
|
|
||
| - `intake`: sources, provenance, constraints, ownership, outcome | ||
| - `pipeline`: ingestion, normalization, transforms, freshness, publication | ||
| - `quality`: tests, expectations, invariants, fail policy | ||
| - `ontology`: canonical objects, properties, links, actions | ||
| - `application`: lowest-complexity UI/workflow/API implementation | ||
| - `security`: least privilege, boundaries, secrets, write controls | ||
| - `release`: CI, health, downstream impact, rollback, promotion | ||
| - `observer`: lineage, evidence, unresolved risk, completion status | ||
|
|
||
| The deterministic shared context is implemented in `server/engineering-context.ts`. | ||
|
|
||
| ## Decision loop | ||
|
|
||
| ```text | ||
| INSPECT | ||
| → MODEL | ||
| → PLAN | ||
| → DECOMPOSE | ||
| → EXECUTE | ||
| → VALIDATE | ||
| → OBSERVE | ||
| → REPAIR | ||
| → APPROVE | ||
| → RELEASE | ||
| → AUDIT | ||
| ``` | ||
|
|
||
| The fleet is a decision-support and orchestration pattern. It does not give an LLM unrestricted execution. Tools remain explicitly bounded, read/write access stays distinguishable, consequential writes/releases follow application policy and approval gates, and completion requires evidence. | ||
|
|
||
| ## Application principles | ||
|
|
||
| - Start from the ontology/domain model before UI detail. | ||
| - Treat widgets/components as explicit input/output units with typed state and events. | ||
| - Route domain mutations through governed actions rather than arbitrary client-side writes. | ||
| - Give LLMs only the context, tools, variables, objects, functions, searches, and actions required by the current workflow. | ||
| - Prefer lower-complexity application surfaces until custom code is justified. | ||
|
|
||
| ## Data principles | ||
|
|
||
| - Separate source cleanup, reusable transforms, canonical/ontology outputs, and consuming workflows. | ||
| - Publish stable contracts with ownership, schema, freshness, provenance, and known downstream consumers. | ||
| - Encode critical assumptions as executable quality gates and prevent invalid data from propagating. | ||
| - Use batch unless incremental or streaming requirements justify extra operational complexity. | ||
| - Treat lineage, health, build evidence, and rollback as production features. | ||
|
|
||
| This document and `server/engineering-context.ts` are XUNIA/Zyra implementations of public engineering concepts, not Palantir Foundry components and not evidence of Palantir affiliation or tenant access. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import assert from "node:assert/strict"; | ||
| import test from "node:test"; | ||
|
|
||
| import { | ||
| ENGINEERING_DECISION_LOOP, | ||
| ENGINEERING_GUIDE_SOURCES, | ||
| ENGINEERING_STACK_STAGES, | ||
| buildEngineeringSystemContext, | ||
| engineeringMissionPlan, | ||
| selectEngineeringFleet, | ||
| } from "./engineering-context"; | ||
|
|
||
| test("engineering sources include both supplied Palantir Learn guides", () => { | ||
| assert.equal(ENGINEERING_GUIDE_SOURCES.length, 2); | ||
| assert.ok(ENGINEERING_GUIDE_SOURCES.some(url => url.includes("data-engineer-guide"))); | ||
| assert.ok(ENGINEERING_GUIDE_SOURCES.some(url => url.includes("application-developer-guide"))); | ||
| }); | ||
|
|
||
| test("data mission selects pipeline, quality, ontology, security, release, and observer roles", () => { | ||
| const ids = selectEngineeringFleet("Build a streaming data pipeline with schema validation").map(role => role.id); | ||
| assert.deepEqual(ids, ["intake", "pipeline", "quality", "ontology", "security", "release", "observer"]); | ||
| }); | ||
|
|
||
| test("application mission selects ontology and application roles", () => { | ||
| const ids = selectEngineeringFleet("Build a React application with ontology objects and actions").map(role => role.id); | ||
| assert.deepEqual(ids, ["intake", "ontology", "application", "security", "release", "observer"]); | ||
| }); | ||
|
|
||
| test("production mission requires approval", () => { | ||
| const plan = engineeringMissionPlan("Deploy the application to production"); | ||
| assert.equal(plan.approvalRequired, true); | ||
| assert.ok(plan.completionGates.includes("execution evidence recorded")); | ||
| }); | ||
|
|
||
| test("stack and decision loop are complete", () => { | ||
| assert.equal(ENGINEERING_STACK_STAGES.at(-1), "AUDIT"); | ||
| assert.equal(ENGINEERING_DECISION_LOOP.at(0), "INSPECT"); | ||
| assert.equal(ENGINEERING_DECISION_LOOP.at(-1), "AUDIT"); | ||
| const context = buildEngineeringSystemContext("test"); | ||
| assert.match(context, /bounded specialist fleet/i); | ||
| assert.match(context, /approval-gated/i); | ||
| assert.match(context, /Palantir affiliation/i); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| export const ENGINEERING_GUIDE_SOURCES = [ | ||
| "https://learn.palantir.com/data-engineer-guide/1388785", | ||
| "https://learn.palantir.com/application-developer-guide/1481796", | ||
| ] as const; | ||
|
|
||
| export const ENGINEERING_STACK_STAGES = [ | ||
| "SOURCE/INTAKE", | ||
| "PIPELINE", | ||
| "QUALITY", | ||
| "ONTOLOGY", | ||
| "APPLICATION", | ||
| "AIP/LLM", | ||
| "SECURITY", | ||
| "RELEASE", | ||
| "AUDIT", | ||
| ] as const; | ||
|
|
||
| export const ENGINEERING_DECISION_LOOP = [ | ||
| "INSPECT", | ||
| "MODEL", | ||
| "PLAN", | ||
| "DECOMPOSE", | ||
| "EXECUTE", | ||
| "VALIDATE", | ||
| "OBSERVE", | ||
| "REPAIR", | ||
| "APPROVE", | ||
| "RELEASE", | ||
| "AUDIT", | ||
| ] as const; | ||
|
|
||
| export const ENGINEERING_FLEET = [ | ||
| { id: "intake", mission: "Inspect sources, provenance, constraints, ownership, and outcomes." }, | ||
| { id: "pipeline", mission: "Design ingestion, normalization, transforms, publication, and freshness contracts." }, | ||
| { id: "quality", mission: "Define tests, expectations, integrity checks, and fail-closed invariants." }, | ||
| { id: "ontology", mission: "Model canonical objects, properties, links, actions, and semantic contracts." }, | ||
| { id: "application", mission: "Build the lowest-complexity workflow, UI, or API surface that meets the need." }, | ||
| { id: "security", mission: "Check least privilege, data boundaries, write controls, secrets, and abuse cases." }, | ||
| { id: "release", mission: "Verify CI, health, downstream impact, rollback, and promotion evidence." }, | ||
| { id: "observer", mission: "Track lineage, evidence, unresolved risk, status, and claimed completion." }, | ||
| ] as const; | ||
|
|
||
| const DATA_TERMS = ["data", "dataset", "pipeline", "ingestion", "transform", "etl", "streaming", "batch", "schema"]; | ||
| const APP_TERMS = ["app", "application", "frontend", "backend", "ui", "widget", "workflow", "react", "api"]; | ||
| const ONTOLOGY_TERMS = ["ontology", "object", "objects", "link", "links", "semantic", "action"]; | ||
| const HIGH_IMPACT_TERMS = ["production", "deploy", "release", "delete", "migrate", "payment", "credential", "external action"]; | ||
|
|
||
| function escapeRegex(term: string): string { | ||
| return term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | ||
| } | ||
|
|
||
| function includesAny(input: string, terms: readonly string[]): boolean { | ||
| const lower = input.toLowerCase(); | ||
| return terms.some(term => { | ||
| if (term.includes(" ")) return lower.includes(term); | ||
| return new RegExp(`(?<![a-z0-9])${escapeRegex(term)}(?![a-z0-9])`).test(lower); | ||
| }); | ||
| } | ||
|
|
||
| export function selectEngineeringFleet(objective: string) { | ||
| const selected = new Set<string>(["intake"]); | ||
| const isData = includesAny(objective, DATA_TERMS); | ||
| const isApp = includesAny(objective, APP_TERMS); | ||
| const isOntology = includesAny(objective, ONTOLOGY_TERMS); | ||
|
|
||
| if (isData) { | ||
| selected.add("pipeline"); | ||
| selected.add("quality"); | ||
| } | ||
| if (isData || isApp || isOntology) selected.add("ontology"); | ||
| if (isApp) selected.add("application"); | ||
| selected.add("security"); | ||
| selected.add("release"); | ||
| selected.add("observer"); | ||
|
|
||
| return ENGINEERING_FLEET.filter(role => selected.has(role.id)); | ||
| } | ||
|
|
||
| export function engineeringMissionPlan(objective: string) { | ||
| return { | ||
| objective: objective.trim(), | ||
| stages: [...ENGINEERING_STACK_STAGES], | ||
| decisionLoop: [...ENGINEERING_DECISION_LOOP], | ||
| roles: selectEngineeringFleet(objective), | ||
| approvalRequired: includesAny(objective, HIGH_IMPACT_TERMS), | ||
| completionGates: [ | ||
| "source and provenance known", | ||
| "contracts and ontology reviewed", | ||
| "tests and data expectations pass", | ||
| "security checks pass", | ||
| "downstream impact reviewed", | ||
| "rollback path exists", | ||
| "execution evidence recorded", | ||
| ], | ||
| }; | ||
| } | ||
|
|
||
| export function buildEngineeringSystemContext(scope = "general engineering"): string { | ||
| return [ | ||
| "Use the Zyra/XUNIA clean-room Palantir Engineering Stack for relevant engineering work.", | ||
| `Scope: ${scope}.`, | ||
| `Stages: ${ENGINEERING_STACK_STAGES.join(" -> ")}.`, | ||
| `Decision loop: ${ENGINEERING_DECISION_LOOP.join(" -> ")}.`, | ||
| `Bounded specialist fleet: ${ENGINEERING_FLEET.map(role => role.id).join(", ")}.`, | ||
| "Ground work in explicit data/schema/ontology/action/tool/UI contracts, lineage, quality gates, and evidence.", | ||
| "Give LLMs only the context and tools required for the workflow; distinguish read from write access.", | ||
| "Consequential writes and releases stay approval-gated, reversible, and auditable.", | ||
| "Prefer the lowest-complexity application surface that satisfies the workflow.", | ||
| "Do not claim Palantir affiliation, certification, tenant access, or proprietary implementation details.", | ||
| ].join(" "); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add YAML frontmatter containing at least
nameanddescription. The skill loader uses those fields to discover and select skills, so without themzyra-engineering-fleetis omitted from the available skill registry and will not trigger for the engineering tasks this commit intends it to handle; references to it from the architecture and adaptive-intelligence skills do not restore independent discovery.Useful? React with 👍 / 👎.