-
Notifications
You must be signed in to change notification settings - Fork 0
Add cross-org ecosystem inventory and shared automation OpenAPI contract #3
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
Changes from all commits
c0495ab
0d8e336
e49267b
acdc4e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,269 @@ | ||
| openapi: 3.1.0 | ||
| info: | ||
| title: Pmaster Automation API | ||
| version: 0.1.0 | ||
| description: Shared automation contracts for the Pmaster-dev and pinkycollie ecosystem. | ||
| servers: | ||
| - url: / | ||
| description: Base URL resolved by each deployment environment | ||
| tags: | ||
| - name: Automation | ||
| - name: Runs | ||
| paths: | ||
| /automation/events/trigger: | ||
| post: | ||
| tags: [Automation] | ||
| summary: Trigger automation runs for an event | ||
| operationId: triggerAutomationEvent | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/TriggerEventRequest' | ||
| responses: | ||
| '200': | ||
| description: Trigger processed | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| runs: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/RunResult' | ||
| required: [runs] | ||
| /automation/definitions: | ||
| get: | ||
| tags: [Automation] | ||
| summary: List automation definitions | ||
| operationId: listAutomationDefinitions | ||
| responses: | ||
| '200': | ||
| description: Current definitions | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| definitions: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/AutomationDefinition' | ||
| required: [definitions] | ||
| /automation/definitions/{name}: | ||
| put: | ||
| tags: [Automation] | ||
| summary: Create or replace an automation definition | ||
| operationId: upsertAutomationDefinition | ||
| parameters: | ||
| - $ref: '#/components/parameters/AutomationName' | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/AutomationDefinition' | ||
| responses: | ||
| '200': | ||
| description: Definition stored | ||
| delete: | ||
| tags: [Automation] | ||
| summary: Remove an automation definition | ||
| operationId: deleteAutomationDefinition | ||
| parameters: | ||
| - $ref: '#/components/parameters/AutomationName' | ||
| responses: | ||
| '204': | ||
| description: Definition removed | ||
| '404': | ||
| description: Definition not found | ||
| /automation/definitions/{name}/enable: | ||
| post: | ||
| tags: [Automation] | ||
| summary: Enable a definition | ||
| operationId: enableAutomationDefinition | ||
| parameters: | ||
| - $ref: '#/components/parameters/AutomationName' | ||
| responses: | ||
| '204': | ||
| description: Definition enabled | ||
| /automation/definitions/{name}/disable: | ||
| post: | ||
| tags: [Automation] | ||
| summary: Disable a definition | ||
| operationId: disableAutomationDefinition | ||
| parameters: | ||
| - $ref: '#/components/parameters/AutomationName' | ||
| responses: | ||
| '204': | ||
| description: Definition disabled | ||
| /automation/runs: | ||
| get: | ||
| tags: [Runs] | ||
| summary: List run history | ||
| operationId: listAutomationRuns | ||
| parameters: | ||
| - name: limit | ||
| in: query | ||
| required: false | ||
| schema: | ||
| type: integer | ||
| minimum: 1 | ||
| maximum: 1000 | ||
| default: 50 | ||
| responses: | ||
| '200': | ||
| description: Run history entries | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| runs: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/RunResult' | ||
| required: [runs] | ||
| /automation/stats: | ||
| get: | ||
| tags: [Runs] | ||
| summary: Get aggregate automation stats | ||
| operationId: getAutomationStats | ||
| responses: | ||
| '200': | ||
| description: Aggregate counters by status | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/AutomationStats' | ||
| components: | ||
| parameters: | ||
| AutomationName: | ||
| name: name | ||
| in: path | ||
| required: true | ||
| schema: | ||
| type: string | ||
| schemas: | ||
| TriggerEventRequest: | ||
| type: object | ||
| properties: | ||
| event_type: | ||
| type: string | ||
| payload: | ||
| description: Event payload forwarded to automation steps. | ||
| type: object | ||
| additionalProperties: true | ||
| nullable: true | ||
|
Comment on lines
+155
to
+159
|
||
| metadata: | ||
|
Comment on lines
+153
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Payload type mismatch TriggerEventRequest.payload is constrained to an object in the OpenAPI contract, but the automation engine accepts arbitrary payload types (and the repo’s own example passes a string). This makes the contract reject valid events or forces clients to wrap non-object payloads, diverging from current runtime behavior. Agent Prompt
|
||
| type: object | ||
| additionalProperties: true | ||
| default: {} | ||
| required: [event_type] | ||
| AutomationDefinition: | ||
| type: object | ||
| properties: | ||
| name: | ||
| type: string | ||
| triggers: | ||
| type: array | ||
| items: | ||
| type: string | ||
| steps: | ||
| type: array | ||
| description: Ordered component names to execute in sequence. | ||
| items: | ||
| type: string | ||
| variables: | ||
| type: array | ||
| description: Variable names resolved from the runtime variable registry. | ||
| items: | ||
| type: string | ||
| default: [] | ||
| description: | ||
| type: string | ||
| default: '' | ||
| enabled: | ||
| type: boolean | ||
| default: true | ||
| required: [name, triggers, steps] | ||
| RunStatus: | ||
| type: string | ||
| enum: [pending, running, success, failed, skipped] | ||
| ComponentOutput: | ||
| type: object | ||
| properties: | ||
| component: | ||
| type: string | ||
| success: | ||
| type: boolean | ||
| result: | ||
| nullable: true | ||
|
Comment on lines
+202
to
+203
|
||
| error: | ||
| type: string | ||
| nullable: true | ||
|
Comment on lines
+204
to
+206
|
||
| metadata: | ||
| type: object | ||
| additionalProperties: true | ||
| default: {} | ||
| required: [component, success] | ||
| RunResult: | ||
| type: object | ||
| properties: | ||
| run_id: | ||
| type: string | ||
| trigger: | ||
| type: object | ||
| properties: | ||
| event_type: | ||
| type: string | ||
| event_id: | ||
| type: string | ||
| timestamp: | ||
| type: string | ||
| format: date-time | ||
| required: [event_type, event_id, timestamp] | ||
| status: | ||
| $ref: '#/components/schemas/RunStatus' | ||
| outputs: | ||
| type: array | ||
| items: | ||
| $ref: '#/components/schemas/ComponentOutput' | ||
| started_at: | ||
| type: string | ||
| format: date-time | ||
| nullable: true | ||
|
Comment on lines
+234
to
+237
|
||
| finished_at: | ||
| type: string | ||
| format: date-time | ||
| nullable: true | ||
|
Comment on lines
+238
to
+241
|
||
| duration_ms: | ||
| type: number | ||
| nullable: true | ||
|
Comment on lines
+242
to
+244
|
||
| error: | ||
| type: string | ||
| nullable: true | ||
|
Comment on lines
+245
to
+247
|
||
| required: [run_id, trigger, status, outputs] | ||
|
Comment on lines
+234
to
+248
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Oas3.1 nullable keyword The OpenAPI document declares openapi: 3.1.0 but uses nullable: true in multiple schemas, which reduces interoperability with JSON-Schema-based OpenAPI 3.1 tooling. This can lead to clients/validators treating fields as non-nullable or failing validation depending on the toolchain. Agent Prompt
|
||
| AutomationStats: | ||
| type: object | ||
| properties: | ||
| total_runs: | ||
| type: integer | ||
| minimum: 0 | ||
| automations: | ||
| type: integer | ||
| minimum: 0 | ||
| components: | ||
| type: integer | ||
| minimum: 0 | ||
| variables: | ||
| type: integer | ||
| minimum: 0 | ||
| by_status: | ||
| type: object | ||
| additionalProperties: | ||
| type: integer | ||
| minimum: 0 | ||
| required: [total_runs, automations, components, variables, by_status] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # pinkycollie + Pmaster-dev ecosystem inventory | ||
|
|
||
| ## Objective | ||
|
|
||
| Maintain `pinkycollie` product repos and `Pmaster-dev` infrastructure repos as one coordinated ecosystem with shared CI/CD, API contracts, and automation flows. | ||
|
|
||
| ## Ecosystem snapshot | ||
|
|
||
| | Org | Key repos | Current role | | ||
| |---|---|---| | ||
| | `pinkycollie` | `pinkflow`, `deaf-first-platform`, `mbtq-dev`, `NegraRosa`, `VR4Deaf` | Product/application layer with broad TS + Python footprint | | ||
| | `Pmaster-dev` | `server`, `docs`, `actions`, `electron`, `.github` | Infrastructure/automation layer, reusable tooling, shared contracts | | ||
|
|
||
| ## Layer 1 — single source of truth for templates | ||
|
|
||
| - Keep `Pmaster-dev/.github` as the org template hub: | ||
| - shared `CODEOWNERS` | ||
| - reusable workflows in `ci/` and `deployments/` | ||
| - shared pre-commit config | ||
| - Mirror the same model in `pinkycollie` using `pinkycollie/pinkflow` as the workflow hub. | ||
| - Replace duplicated per-repo workflows with reusable `workflow_call` workflows. | ||
|
|
||
| ## Layer 2 — standardized pipeline lifecycle | ||
|
|
||
| Standard stage order for every repo: | ||
|
|
||
| `[Scan/Lint] → [Build] → [Test] → [Security] → [Deploy/Publish]` | ||
|
|
||
| Target mapping: | ||
|
|
||
| - Scan: `pr-security.yml`, `semgrep.yml`, `codeql.yml` | ||
| - Lint: `pylint.yml`, `super-linter.yml` | ||
| - Build: `rust-ci.yml`, `nextjs.yml`, `deploy-marketing-site.yml` | ||
| - Test: `vitest`, `pytest` | ||
| - Deploy: `github-pages.yml`, `deploy.yml`, `release.yml` | ||
|
|
||
| ## Layer 3 — framework instances to align | ||
|
|
||
| | Instance | Pmaster-dev | pinkycollie | | ||
| |---|---|---| | ||
| | API server | `server/src/automation` | `pinkflow/webapp/backend` | | ||
| | API docs | `docs/openapi/` | `pinkflow/API.md` (migrate to OpenAPI) | | ||
| | Desktop client | `electron` | — | | ||
| | CI action | `actions/action.yml` | `pinkflow/.github/workflows/PinkFlow-pipeline.yml` | | ||
| | Marketing/docs site | — | `pinkflow/marketing-site/` | | ||
| | Web app | — | `pinkflow/webapp/frontend/` | | ||
| | Auth layer | — | `Nextjs-DeafAUTH` | | ||
|
|
||
| ## Layer 4 — integration method rule | ||
|
|
||
| - Default to **REST** for user-initiated synchronous CRUD flows. | ||
| - Use **Webhook** for asynchronous automation events (CI, release, cross-repo signals). | ||
| - Defer **gRPC/tRPC** until latency/throughput needs justify protocol expansion. | ||
|
|
||
| ## Layer 5 — cross-org webhook bridge | ||
|
|
||
| Reference flow: | ||
|
|
||
| `Pmaster-dev/* push/release` → `Pmaster-dev/actions` → dispatch/webhook to `pinkycollie/pinkflow` → update workflow state → run downstream checks → report status back to source PR/check. | ||
|
|
||
| ## Layer 6 — versioned artifacts | ||
|
|
||
| - Machine-readable contracts: `docs/openapi/*.yaml` | ||
| - Human-readable operational docs: `pinkflow/docs/`, `pinkflow/workflow-system/docs/` | ||
| - Agent/system context: `pinkflow/context/agents.md` | ||
| - Cross-org map (this file): `docs/pinkycollie-ecosystem-inventory.md` | ||
|
|
||
| ## Priority sequence | ||
|
|
||
| 1. Commit this ecosystem inventory document in `Pmaster-dev/server`. | ||
| 2. Publish shared automation OpenAPI contracts under `docs/openapi/`. | ||
| 3. Refactor duplicated `pinkflow` workflows into reusable `workflow_call` units. | ||
| 4. Wire webhook bridge from `Pmaster-dev/actions` to `pinkflow/waitthenecho`. | ||
| 5. Standardize framework package versions (Next.js/React) across frontend repos. |
Uh oh!
There was an error while loading. Please reload this page.