Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .clinerules/first-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ When analyzing the project, check for:

### Configuration Files
- `package.json` - for build commands, dependencies, and scripts
- `tsconfig.json` - for TypeScript configuration
- `tsconfig.json` and `packages/*/tsconfig.json` - for TypeScript configuration
- `eslint.config.js` - for linting rules
- `prettier.config.js` - for formatting rules
- `jest.config.js` or `vitest.config.ts` - for testing configuration
Expand All @@ -25,9 +25,9 @@ When analyzing the project, check for:

**BEFORE making any recommendations, verify:**

- [ ] `tsconfig.json` exists
- [ ] `packages/*/tsconfig.json` exist
- [ ] `packages/` directory exists (monorepo structure)
- [ ] `src/` directory exists (implementation)
- [ ] `packages/*/src` exists for implemented packages
- [ ] `.github/workflows/` exists (CI/CD)
- [ ] Test runner configured (Vitest/Jest)
- [ ] ESLint configured
Expand All @@ -43,10 +43,13 @@ When analyzing the project, check for:
4. **Recommend** Phase 01/02 tasks before feature implementation

**Current Status (March 2026):**
- ✅ Architecture documentation complete in `.context/`
- ✅ 10-phase implementation plan ready with Admin Enablement stream
- ✅ 9 ADRs drafted including hybrid admin model
- ❌ No implementation yet (target: Phase 01-03)
- Architecture documentation complete in `.context/`
- 10-phase implementation plan ready with Admin Enablement stream
- 9 ADRs drafted including hybrid admin model
- Phase 01 governance workflows are implemented
- Phase 02 workspace/package baseline is implemented
- Phase 03 SDK contract baseline is implemented
- Current active implementation phase: Phase 04 (contract conformance package)

### Existing Rules
- `.cursorrules` - Cursor-specific rules
Expand Down Expand Up @@ -97,9 +100,10 @@ When analyzing the project, check for:
- Deployment considerations

**Current Phase Priority:**
- Phase 01: Governance Activation (CI gates, branch protection)
- Phase 02: Monorepo Package Skeleton
- Phase 03: SDK Contract Baseline
- Completed: Phase 01 Governance Activation (CI gates, branch protection)
- Completed: Phase 02 Monorepo Package Skeleton
- Completed: Phase 03 SDK Contract Baseline
- Active: Phase 04 Contract Conformance Test Package
- (See `.context/04-implementation-plan/` for full roadmap)

### Performance & Security
Expand Down
18 changes: 9 additions & 9 deletions .context/03-work-plan/00-assumptions-and-audit-findings.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 00 Assumptions and Deep Audit Findings

## Status Update (2026-03-29)
## Status Update (2026-03-30)
- Repository reality has progressed since this audit baseline.
- Phase 01 governance assets and Phase 02 workspace/package baseline are now completed.
- Runtime implementation remains pending (Phase 03 onward).
- Phase 01 governance assets, Phase 02 workspace/package baseline, and Phase 03 SDK contract baseline are now completed.
- Runtime implementation remains pending (Phase 04 onward).
- Treat findings below as an early-stage audit snapshot unless explicitly updated by newer phase artifacts.

## 1. Key Assumptions

1. The platform follows a mixed strategy: internal MVP first, then external ecosystem expansion.
2. The current repository has completed governance and workspace baseline phases (Phase 01 and Phase 02) and still has no production runtime code.
2. The current repository has completed governance/workspace baseline plus SDK contract baseline phases (Phase 01 through Phase 03) and still has no production runtime code.
3. The main business objective of the first stage is to reduce time-to-first-module while keeping architecture quality high enough for externalization.
4. The second-stage objective is secure and predictable third-party module onboarding with clear compatibility governance.
5. This audit is evidence-based from repository artifacts and architecture documents, not from executed runtime behavior.
Expand All @@ -36,7 +36,7 @@

## 3. Executive Summary

The project has strong architecture intent and unusually mature design documentation for an early stage. Current risk has shifted from missing baseline assets to delivery sequencing: governance and workspace boundaries are implemented, while SDK/runtime/test execution capabilities are still being built.
The project has strong architecture intent and unusually mature design documentation for an early stage. Current risk has shifted from missing baseline assets to delivery sequencing: governance and workspace boundaries plus SDK contracts are implemented, while runtime/conformance execution capabilities are still being built.

Net assessment:
- Product and architecture direction: strong
Expand Down Expand Up @@ -84,7 +84,7 @@ Net assessment:
- Lifecycle and module loading model are coherent and testable.

### Gaps
- No source implementation for core contracts in this repository state.
- No core runtime contract execution implementation in this repository state.
- Runtime packages still expose only placeholder entry points.
- Boundary enforcement is baseline-level and does not yet include runtime-policy and contract conformance implementation.

Expand Down Expand Up @@ -165,7 +165,7 @@ Net assessment:
- Quality gates are present at design level.

### Gaps
- No test framework standard formally enforced in project scripts.
- No repository-wide test framework standard is formally enforced in root scripts (SDK package uses Vitest baseline).
- Contract test package exists as a workspace baseline, but no executable conformance suite is implemented yet.

### Risks
Expand Down Expand Up @@ -213,7 +213,7 @@ Net assessment:
## 5. Bottlenecks, Technical Debt, Hidden Dependencies

## 5.1 Primary Bottlenecks
1. Implementation gap: runtime and SDK contracts are not implemented yet.
1. Implementation gap: runtime kernel and contract-conformance suites are not implemented yet.
2. Automation gap: runtime, contract-conformance, and lifecycle determinism checks are not yet executable.
3. Product instrumentation gap: no measurable KPI dashboard for MVP learning loop.

Expand All @@ -231,6 +231,6 @@ Net assessment:

High priority themes for next execution window:
1. Convert architecture intent into executable guardrails.
2. Establish SDK contracts plus contract test package before core feature growth.
2. Complete contract test package implementation and reference-module validation before core feature growth.
3. Implement baseline CI policy gates to prevent early architectural drift.
4. Instrument product and platform KPIs for internal MVP validation.
4 changes: 2 additions & 2 deletions .context/03-work-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This directory contains the actionable deep-audit outcome for `prosto-platform` under a mixed strategy:
internal MVP first, then external ecosystem scale-out.

## Status Note (2026-03-29)
- Phase 01 and Phase 02 are completed in repository reality.
## Status Note (2026-03-30)
- Phase 01, Phase 02, and Phase 03 are completed in repository reality.
- This directory primarily captures audit and planning guidance produced before runtime implementation phases.
- For live phase status, use `.context/04-implementation-plan/README.md` and the root `README.md`.

Expand Down
75 changes: 55 additions & 20 deletions .context/04-implementation-plan/03-phase.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Phase 03 - SDK Contract Baseline and Manifest Validation

## Execution Status
- Status: Completed
- Completed on: 2026-03-29
- Validation date: 2026-03-30
- Repository evidence:
- `packages/platform-sdk/package.json`
- `packages/platform-sdk/src/index.ts`
- `packages/platform-sdk/src/types/manifest.types.ts`
- `packages/platform-sdk/src/types/lifecycle.types.ts`
- `packages/platform-sdk/src/types/tokens.types.ts`
- `packages/platform-sdk/src/constants/lifecycle.constants.ts`
- `packages/platform-sdk/src/constants/manifest.constants.ts`
- `packages/platform-sdk/src/constants/tokens.constants.ts`
- `packages/platform-sdk/src/interfaces/platform-module.interface.ts`
- `packages/platform-sdk/src/interfaces/platform-module-manifest.interface.ts`
- `packages/platform-sdk/src/interfaces/module-context.interface.ts`
- `packages/platform-sdk/src/interfaces/service-registry.interface.ts`
- `packages/platform-sdk/src/interfaces/event-bus.interface.ts`
- `packages/platform-sdk/src/interfaces/module-logger.interface.ts`
- `packages/platform-sdk/src/errors/platform-sdk.error.ts`
- `packages/platform-sdk/src/errors/manifest-validation.error.ts`
- `packages/platform-sdk/src/errors/compatibility-validation.error.ts`
- `packages/platform-sdk/src/schemas/manifest.schema.ts`
- `packages/platform-sdk/src/utils/semver.utils.ts`
- `packages/platform-sdk/src/utils/tokens.utils.ts`
- `packages/platform-sdk/src/validation/manifest.validation.ts`
- `packages/platform-sdk/src/validation/compatibility.validation.ts`
- `packages/platform-sdk/tests/manifest-validation.test.ts`
- `packages/platform-sdk/tests/compatibility-validation.test.ts`
- `packages/platform-sdk/tests/tokens.test.ts`
- `packages/platform-sdk/tests/tokens.type-test.ts`
- `packages/platform-sdk/vitest.config.ts`
- `packages/platform-sdk/API_REPORT.md`
- `packages/platform-sdk/README.md`

## Phase Objective
Implement `@prosto/platform-sdk` as the single contract authority for modules, manifests, lifecycle interfaces, service tokens, and validation primitives.

Expand All @@ -22,23 +57,23 @@ Implement `@prosto/platform-sdk` as the single contract authority for modules, m
- `.context/02-architecture-design/02-domain-and-capability-model.md`
- `.context/02-architecture-design/adr/ADR-0002-sdk-contract-and-semver-governance.md`

## Detailed Ordered Implementation Steps
1. Implement manifest types in `platform-sdk/src/types`:
## Delivered Implementation Steps
1. Implemented manifest types in `platform-sdk/src/types`:
- module identity
- version ranges
- security class
- criticality
- capabilities
2. Implement lifecycle and context interfaces in `platform-sdk/src/interfaces`:
2. Implemented lifecycle and context interfaces in `platform-sdk/src/interfaces`:
- `PlatformModule`
- `ModuleContext`
- `ServiceRegistry`
- `EventBus`
3. Implement tokens model in `platform-sdk/src/tokens` with typed token helper.
4. Implement manifest schema and semantic validation helpers in `platform-sdk/src/validation`.
5. Define explicit error model for validation and compatibility failures.
6. Add package-level API report and stability labels for each exported symbol.
7. Add unit tests for:
3. Implemented token model via `platform-sdk/src/types` (token brands), `src/constants` (prefixes), and `src/utils` (typed token helpers).
4. Implemented manifest schema and semantic validation helpers in `platform-sdk/src/validation`.
5. Defined explicit error model for validation and compatibility failures.
6. Added package-level API report and stability labels for each exported symbol.
7. Added unit and type-level tests for:
- schema validation pass/fail cases
- semver compatibility validation
- token uniqueness and typing behavior
Expand All @@ -60,7 +95,7 @@ export interface PlatformModule {
export const PlatformModuleManifestSchema = z.object({
id: z.string().min(3),
version: z.string(),
platformVersion: z.string(),
sdkVersion: z.string(),
criticality: z.enum(['normal', 'critical']),
securityClass: z.enum(['trusted', 'internal', 'third-party-reviewed']),
capabilities: z.array(z.string()).min(1)
Expand All @@ -71,31 +106,31 @@ export const PlatformModuleManifestSchema = z.object({
```typescript
export type ServiceToken<T> = symbol & { readonly __type?: T };

export const SERVICE_TOKEN_NAME_PREFIX = '__PPS_' // Prosto Platform Service
export const SERVICE_TOKEN_NAME_PREFIX = 'PRST_PL_SERVICE_'

export function createServiceToken<T>(name: string): ServiceToken<T> {
return Symbol.for(SERVICE_TOKEN_NAME_PREFIX + name) as ServiceToken<T>;
}
```

## Affected Modules or Files
### Existing files likely updated
## Delivered Files Overview
- `packages/platform-sdk/package.json`
- `packages/platform-sdk/src/index.ts`

### New files expected
- `packages/platform-sdk/src/types/*.ts`
- `packages/platform-sdk/src/interfaces/*.ts`
- `packages/platform-sdk/src/tokens/*.ts`
- `packages/platform-sdk/src/constants/*.ts`
- `packages/platform-sdk/src/utils/*.ts`
- `packages/platform-sdk/src/schemas/*.ts`
- `packages/platform-sdk/src/validation/*.ts`
- `packages/platform-sdk/src/errors/*.ts`
- `packages/platform-sdk/test/*.test.ts`
- `packages/platform-sdk/tests/*.test.ts`
- `packages/platform-sdk/vitest.config.ts`
- `packages/platform-sdk/API_REPORT.md`

## Validation and Testing Approach
- Unit tests for schema, types, and semver rules.
- Type-level tests for token and interface contracts.
- Public API snapshot to detect accidental breaking changes.
- CI gate requiring full pass before downstream package integration.
- Package tests run through `npm run --workspace @prosto/platform-sdk test` (Vitest unit tests plus type-level checks).
- Build and declaration checks run through `npm run --workspace @prosto/platform-sdk build` and `typecheck`.
- Public API report recorded in `packages/platform-sdk/API_REPORT.md` to track contract surface drift.

## Data or Migration Impact
- No runtime data migration.
Expand Down
13 changes: 8 additions & 5 deletions .context/04-implementation-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
This index consolidates the execution-ready implementation plan for `prosto-platform` based on the current repository state and architecture artifacts in `.context/02-architecture-design` and `.context/03-work-plan`.

## Planning Baseline
- Repository has completed Phase 01 governance activation and Phase 02 workspace/package baseline setup.
- Repository has completed Phase 01 governance activation, Phase 02 workspace/package baseline setup, and Phase 03 SDK contract baseline delivery.
- No production runtime implementation is present yet; runtime phases begin after SDK contracts are established.
- Architecture intent emphasizes micro-core boundaries, contract-first delivery, deterministic lifecycle, security-first module loading, and hybrid admin model with shell plus UI plugins.
- This plan is sequenced to reduce early architecture drift and keep risk controls enforceable from the first implementation increment.

## Execution Status (As of 2026-03-29)
## Execution Status (As of 2026-03-30, post-Phase 03 validation)
- `Phase 01`: Completed (governance workflows, required checks documentation, PR template, release evidence script).
- `Phase 02`: Completed (workspace packages, TypeScript baseline, dependency and public API boundary checks, dependency map).
- `Current active phase`: Phase 03 (SDK contract baseline and manifest validation).
- `Phases 04-10`: Planned.
- `Phase 03`: Completed (SDK contracts, manifest schema/semantic validation, typed tokens, validation errors, unit and type-level tests).
- `Current active phase`: Phase 04 (contract conformance test package and reference module validation; implementation in progress).
- `Phases 05-10`: Planned.

## Phase Order
1. [Phase 01 - Governance Activation and Delivery Guardrails](./01-phase.md)
Expand Down Expand Up @@ -72,7 +73,9 @@ Runs internal production-like MVP validation, proves KPI and SLO trends, and iss
Current dependency fulfillment:
- Phase 01 prerequisite: satisfied.
- Phase 02 prerequisite: satisfied.
- Phase 03 onward: pending implementation.
- Phase 03 prerequisite: satisfied.
- Phase 04: active implementation (started after Phase 03 completion and validation).
- Phases 05-10: pending implementation.

## Milestones and Stage Gates
### M1 Governance Gate Active
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
4 changes: 2 additions & 2 deletions .kilocode/rules/ask.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Project Documentation Rules (Non-Obvious Only)

- Architecture docs in `.context/02-architecture-design/` describe intended platform design and governance, not implemented runtime code in this repo.
- When answering questions about available commands, source of truth is root `package.json`; currently there are no lint/test scripts.
- If asked about single-test execution, explicitly state it is not possible yet without adding a test runner and script wiring.
- When answering questions about available commands, source of truth is root `package.json`; lint and architecture-policy scripts are available, while several runtime/conformance checks are still placeholders.
- If asked about single-test execution, clarify there is no root-level single-test script, but `@prosto/platform-sdk` has package-level Vitest tests.
- Existing `.cursor/rules/*` and `.clinerules/*` contain mostly generic recommendations and can overstate current capabilities; verify against concrete repo files.
- README is intentionally minimal; most detailed context lives in `.context/` and should be labeled as design/draft context.
- For admin UI topics, treat hybrid model from `ADR-0009` as target-state default: separate `admin-shell`, `platform-admin-contracts`, and `platform-adapter-admin-bff`.
Expand Down
8 changes: 4 additions & 4 deletions .kilocode/rules/code.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Project Coding Rules (Non-Obvious Only)

- Repository currently has no `src/`, no root `tsconfig.json`, and no runtime packages from architecture docs; treat `.context/` package layouts as target-state, not editable code locations.
- Root `package.json` defines only TypeScript compile commands (`build`, `dev`, `typecheck`); no lint/test scripts exist, so do not claim eslint/jest commands as available.
- There is no configured single-test runner command in current repo state; if adding tests, first add tooling and scripts explicitly.
- Effective enforced formatting comes from `.editorconfig` only: LF, 2 spaces, max line length 120, with markdown line length disabled.
- Repository has package-level `src/` implementations under `packages/*` and uses package-level `tsconfig.json`; treat `.context/` package layouts as target-state guidance, not direct proof of implemented runtime behavior.
- Root `package.json` includes lint and architecture-policy scripts (`lint`, `lint:fix`, `lint:architecture`, `validate:*`) plus placeholder runtime/conformance scripts; claim only commands that are actually present.
- There is no root-level single-test runner command, but `@prosto/platform-sdk` has package-level Vitest tests.
- Effective formatting/lint baselines come from `.editorconfig` and `eslint.config.mjs`.
- Because root package is ESM (`"type": "module"`), prefer ESM-compatible imports/exports for any new TS/JS files.
- Existing `.cursor/rules/*.md` and `.clinerules/*.md` are generic guidance; when conflicts appear, prefer concrete repository config files and scripts.
4 changes: 2 additions & 2 deletions .kilocode/rules/debug.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Project Debug Rules (Non-Obvious Only)

- In current repository state, missing test/lint commands are expected behavior, not a broken setup: `package.json` only has TypeScript compile/typecheck scripts.
- If a task asks to run a single test, diagnose first as tooling gap: there is no test framework wiring or script entrypoint yet.
- In current repository state, lint and architecture-policy commands are available in root `package.json`, while several runtime/conformance checks remain placeholders by phase design.
- If a task asks to run a single test, check package-level scripts first (for example `@prosto/platform-sdk`), because there is no root-level single-test entrypoint.
- Many architecture constraints are documented under `.context/02-architecture-design/*` and may not map to real runtime code paths yet.
- Treat failures due to non-existent `packages/*` paths as repository-state mismatch unless those directories are actually added.
- If import/runtime issues appear after adding JS/TS files, first validate ESM assumptions because root package is `"type": "module"`.
Loading
Loading