diff --git a/.github/workflows/pyre.yml b/.github/workflows/pyre.yml index b074fbb..8296c3c 100644 --- a/.github/workflows/pyre.yml +++ b/.github/workflows/pyre.yml @@ -51,7 +51,8 @@ jobs: pip install pyre-check - name: Run Pyre (generate SARIF) - run: pyre check --output-format sarif > pyre-results.sarif + continue-on-error: true + run: pyre --output sarif --source-directory src --source-directory auth check > pyre-results.sarif - name: Upload Pyre results to GitHub Code Scanning if: always() diff --git a/docs/openapi/automation.yaml b/docs/openapi/automation.yaml new file mode 100644 index 0000000..579a2fb --- /dev/null +++ b/docs/openapi/automation.yaml @@ -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 + metadata: + 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 + error: + type: string + nullable: true + 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 + finished_at: + type: string + format: date-time + nullable: true + duration_ms: + type: number + nullable: true + error: + type: string + nullable: true + required: [run_id, trigger, status, outputs] + 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] diff --git a/docs/pinkycollie-ecosystem-inventory.md b/docs/pinkycollie-ecosystem-inventory.md new file mode 100644 index 0000000..f897a8d --- /dev/null +++ b/docs/pinkycollie-ecosystem-inventory.md @@ -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. diff --git a/src/automation/__pycache__/__init__.cpython-312.pyc b/src/automation/__pycache__/__init__.cpython-312.pyc index f698bd6..9015d49 100644 Binary files a/src/automation/__pycache__/__init__.cpython-312.pyc and b/src/automation/__pycache__/__init__.cpython-312.pyc differ diff --git a/src/automation/__pycache__/components.cpython-312.pyc b/src/automation/__pycache__/components.cpython-312.pyc index 6c0a3f4..f489f90 100644 Binary files a/src/automation/__pycache__/components.cpython-312.pyc and b/src/automation/__pycache__/components.cpython-312.pyc differ diff --git a/src/automation/__pycache__/engine.cpython-312.pyc b/src/automation/__pycache__/engine.cpython-312.pyc index d34d7d4..8def6af 100644 Binary files a/src/automation/__pycache__/engine.cpython-312.pyc and b/src/automation/__pycache__/engine.cpython-312.pyc differ diff --git a/src/automation/__pycache__/variables.cpython-312.pyc b/src/automation/__pycache__/variables.cpython-312.pyc index d03c19e..2e29932 100644 Binary files a/src/automation/__pycache__/variables.cpython-312.pyc and b/src/automation/__pycache__/variables.cpython-312.pyc differ diff --git a/src/handoff/__pycache__/handoff.cpython-312.pyc b/src/handoff/__pycache__/handoff.cpython-312.pyc new file mode 100644 index 0000000..6622208 Binary files /dev/null and b/src/handoff/__pycache__/handoff.cpython-312.pyc differ