Tighten the test harness#10
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial scaffold for Kloak’s core deployment model plus the first-pass sync/infrastructure/orchestration seams, alongside the repo’s domain + agent-skill documentation needed to support early implementation slices.
Changes:
- Adds shared domain models and package entrypoints (
src/shared,src/index.ts) to establish cross-module contracts. - Implements initial in-memory core repository/service, sync service (with fakes), infrastructure interfaces (with in-memory implementation), and an orchestrator to wire them together.
- Seeds domain documentation (
CONTEXT.md, ADRs, implementation slice doc) and adds a substantial set of agent skill docs/templates.
Reviewed changes
Copilot reviewed 84 out of 84 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/sync/README.md | Documents the sync package responsibilities. |
| src/sync/index.ts | Adds SyncService reconciliation flow and drift diff function. |
| src/sync/fakes.ts | Adds in-memory fakes for Keycloak and infrastructure state reading. |
| src/shared/models.ts | Introduces shared domain model types (deployments, versions, drift, reconciliation). |
| src/shared/index.ts | Re-exports shared models. |
| src/orchestrator/index.ts | Adds DeploymentService to coordinate core + infrastructure + sync. |
| src/infrastructure/README.md | Documents the infrastructure package responsibilities. |
| src/infrastructure/index.ts | Defines infrastructure provisioning interfaces and types. |
| src/infrastructure/in-memory.ts | Adds an in-memory InfrastructureService implementation. |
| src/index.ts | Adds root exports for package modules. |
| src/core/README.md | Documents the core package responsibilities. |
| src/core/index.ts | Adds core API + repository interfaces and in-memory implementations. |
| src/admin-ui/README.md | Documents the admin UI package responsibilities. |
| skills-lock.json | Locks skill sources/paths/hashes for reproducible agent skill setup. |
| README.md | Updates repo description to match current product scope. |
| docs/implementation/0001-first-implementation-slice.md | Captures the first implementation slice scope/topology and expectations. |
| docs/agents/triage-labels.md | Defines label mapping for triage roles used by skills. |
| docs/agents/issue-tracker.md | Documents GitHub issue tracker conventions and gh CLI workflows. |
| docs/agents/domain.md | Documents how skills should consume domain docs/ADRs. |
| docs/adr/0001-opinionated-auth-appliance.md | Records initial product positioning/constraints as an ADR. |
| CONTEXT.md | Establishes the project glossary/ubiquitous language. |
| AGENTS.md | Adds a root index pointing to agent-skill configuration docs. |
| .agents/skills/writing-shape/SKILL.md | Adds user-invoked writing “shape” skill documentation. |
| .agents/skills/writing-great-skills/SKILL.md | Adds reference guidance for authoring/editing skills well. |
| .agents/skills/writing-fragments/SKILL.md | Adds user-invoked writing “fragments” skill documentation. |
| .agents/skills/writing-beats/SKILL.md | Adds user-invoked writing “beats” skill documentation. |
| .agents/skills/wizard/template.sh | Adds the wizard bash template script for guided manual procedures. |
| .agents/skills/wizard/SKILL.md | Adds user-invoked wizard skill documentation. |
| .agents/skills/wayfinder/SKILL.md | Adds user-invoked wayfinder planning skill documentation. |
| .agents/skills/ubiquitous-language/SKILL.md | Adds user-invoked ubiquitous language glossary skill documentation. |
| .agents/skills/triage/SKILL.md | Adds user-invoked triage workflow skill documentation. |
| .agents/skills/triage/OUT-OF-SCOPE.md | Documents out-of-scope KB conventions for triage. |
| .agents/skills/triage/AGENT-BRIEF.md | Documents the expected structure of “agent brief” comments. |
| .agents/skills/to-tickets/SKILL.md | Adds user-invoked “to-tickets” skill documentation. |
| .agents/skills/to-spec/SKILL.md | Adds user-invoked “to-spec” skill documentation. |
| .agents/skills/teach/SKILL.md | Adds user-invoked teaching workspace skill documentation. |
| .agents/skills/teach/RESOURCES-FORMAT.md | Defines RESOURCES.md format for teach skill workspaces. |
| .agents/skills/teach/MISSION-FORMAT.md | Defines MISSION.md format for teach skill workspaces. |
| .agents/skills/teach/LEARNING-RECORD-FORMAT.md | Defines learning record format for teach workspaces. |
| .agents/skills/teach/GLOSSARY-FORMAT.md | Defines glossary format for teach workspaces. |
| .agents/skills/tdd/tests.md | Adds test examples/reference used by the TDD skill. |
| .agents/skills/tdd/SKILL.md | Adds model-invoked TDD skill documentation. |
| .agents/skills/tdd/mocking.md | Adds mocking guidance used by the TDD skill. |
| .agents/skills/setup-pre-commit/SKILL.md | Adds model-invoked pre-commit setup skill documentation. |
| .agents/skills/setup-matt-pocock-skills/triage-labels.md | Template for triage label mapping during skills setup. |
| .agents/skills/setup-matt-pocock-skills/SKILL.md | Adds user-invoked repo skill-setup flow documentation. |
| .agents/skills/setup-matt-pocock-skills/issue-tracker-local.md | Template for local-markdown tracker setup. |
| .agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md | Template for GitLab tracker setup. |
| .agents/skills/setup-matt-pocock-skills/issue-tracker-github.md | Template for GitHub tracker setup. |
| .agents/skills/setup-matt-pocock-skills/domain.md | Template for domain-doc consumer rules. |
| .agents/skills/scaffold-exercises/SKILL.md | Adds model-invoked scaffold-exercises skill documentation. |
| .agents/skills/resolving-merge-conflicts/SKILL.md | Adds model-invoked merge-conflict resolution skill documentation. |
| .agents/skills/research/SKILL.md | Adds model-invoked research skill documentation. |
| .agents/skills/request-refactor-plan/SKILL.md | Adds model-invoked refactor-plan request skill documentation. |
| .agents/skills/qa/SKILL.md | Adds model-invoked QA session skill documentation. |
| .agents/skills/prototype/UI.md | Adds UI prototype branch documentation. |
| .agents/skills/prototype/SKILL.md | Adds model-invoked prototype skill documentation. |
| .agents/skills/prototype/LOGIC.md | Adds logic prototype branch documentation. |
| .agents/skills/obsidian-vault/SKILL.md | Adds model-invoked obsidian-vault skill documentation. |
| .agents/skills/migrate-to-shoehorn/SKILL.md | Adds model-invoked shoehorn migration skill documentation. |
| .agents/skills/loop-me/SKILL.md | Adds user-invoked workflow grilling skill documentation. |
| .agents/skills/improve-codebase-architecture/SKILL.md | Adds user-invoked architecture improvement skill documentation. |
| .agents/skills/improve-codebase-architecture/HTML-REPORT.md | Adds HTML report scaffold/reference for architecture reviews. |
| .agents/skills/implement/SKILL.md | Adds user-invoked implementation skill documentation. |
| .agents/skills/handoff/SKILL.md | Adds user-invoked handoff skill documentation. |
| .agents/skills/grilling/SKILL.md | Adds model-invoked grilling skill documentation. |
| .agents/skills/grill-with-docs/SKILL.md | Adds user-invoked grilling + domain-modeling combo skill doc. |
| .agents/skills/grill-me/SKILL.md | Adds user-invoked grilling skill shortcut doc. |
| .agents/skills/git-guardrails-claude-code/SKILL.md | Adds model-invoked git guardrails setup skill doc. |
| .agents/skills/git-guardrails-claude-code/scripts/block-dangerous-git.sh | Adds hook script to block dangerous git commands. |
| .agents/skills/edit-article/SKILL.md | Adds user-invoked article editing skill doc. |
| .agents/skills/domain-modeling/SKILL.md | Adds model-invoked domain-modeling skill doc. |
| .agents/skills/domain-modeling/CONTEXT-FORMAT.md | Adds canonical CONTEXT.md format reference. |
| .agents/skills/domain-modeling/ADR-FORMAT.md | Adds canonical ADR format reference. |
| .agents/skills/diagnosing-bugs/SKILL.md | Adds model-invoked diagnosing-bugs skill doc. |
| .agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh | Adds HITL loop template for reproductions. |
| .agents/skills/design-an-interface/SKILL.md | Adds model-invoked interface design exploration skill doc. |
| .agents/skills/codebase-design/SKILL.md | Adds model-invoked deep-module vocabulary reference. |
| .agents/skills/codebase-design/DESIGN-IT-TWICE.md | Adds parallel interface-design pattern reference. |
| .agents/skills/codebase-design/DEEPENING.md | Adds dependency-category/testing guidance for deepening. |
| .agents/skills/code-review/SKILL.md | Adds model-invoked two-axis code review skill doc. |
| .agents/skills/claude-handoff/SKILL.md | Adds user-invoked background-agent handoff skill doc. |
| .agents/skills/ask-matt/SKILL.md | Adds user-invoked router skill documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+59
to
+60
| export type DeploymentStatus =|'draft'|'provisioning'|'healthy'|'drifted'| | ||
| 'repairing'|'failed'|'decommissioned'; |
Comment on lines
+120
to
+132
| const version: DeploymentVersion = { | ||
| id: crypto.randomUUID(), | ||
| deploymentId: input.deploymentId, | ||
| number: versionNumber, | ||
| createdBy: input.createdBy, | ||
| notes: input.notes, | ||
| snapshot: input.snapshot, | ||
| createdAt: new Date().toISOString(), | ||
| }; | ||
|
|
||
| await this.repository.saveDeploymentVersion(version); | ||
| await this.repository.recordDesiredState(input.snapshot); | ||
|
|
Comment on lines
+70
to
+88
| await this.persistDeploymentStatus(deployment, 'repairing'); | ||
| await this.dependencies.keycloak.applyDesiredState( | ||
| deployment, desiredState.keycloak); | ||
| await this.dependencies.keycloak.verifyLiveState( | ||
| deployment, desiredState.keycloak); | ||
|
|
||
| const completedRun: ReconciliationRun = { | ||
| id: crypto.randomUUID(), | ||
| deploymentId, | ||
| versionId: desiredState.versionId, | ||
| startedAt, | ||
| finishedAt: this.now().toISOString(), | ||
| status: 'repaired', | ||
| findings, | ||
| }; | ||
|
|
||
| await this.dependencies.repository.recordReconciliationRun(completedRun); | ||
| await this.persistDeploymentStatus(deployment, 'healthy'); | ||
| return completedRun; |
LahkLeKey
force-pushed
the
feature/test-harness-tightening
branch
from
July 10, 2026 05:49
5d54d7c to
0dc9130
Compare
LahkLeKey
force-pushed
the
feature/test-harness-tightening
branch
from
July 10, 2026 06:02
0dc9130 to
8b10fb7
Compare
LahkLeKey
marked this pull request as ready for review
July 10, 2026 06:03
| import {type CoreService, type CreateDeploymentInput, type CreateDeploymentVersionInput} from '../core'; | ||
| import type {InfrastructureService, ProvisioningPlan, ProvisioningResult} from '../infrastructure'; | ||
| import type {Deployment, ReconciliationRun} from '../shared'; | ||
| import {SyncService, type SyncServiceDependencies} from '../sync'; |
| @@ -0,0 +1,5 @@ | |||
| export * from './shared'; | |||
| export * from './core'; | |||
| export * from './sync'; | |||
Comment on lines
+27
to
+28
| function buildExternalReferences(plan: ProvisioningPlan) { | ||
| const externalReferences: Record<string, string> = {}; |
Comment on lines
+133
to
+136
| const normalizedSnapshot = { | ||
| ...input.snapshot, | ||
| versionId: version.id, | ||
| }; |
Comment on lines
+1
to
+2
| import type {InfrastructureService, ProvisioningPlan, ProvisioningResult} from './index'; | ||
|
|
LahkLeKey
force-pushed
the
feature/test-harness-tightening
branch
from
July 11, 2026 06:47
8b10fb7 to
be6383f
Compare
Comment on lines
18
to
35
| @@ -31,14 +31,20 @@ export class DeploymentService { | |||
| this.infrastructure = dependencies.infrastructure; | |||
| this.sync = new SyncService({ | |||
| ...dependencies.syncDependencies, | |||
| repository: extractRepository(dependencies.core), | |||
| repository: dependencies.core.repository, | |||
| }); | |||
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #6
This branch contains the repo bootstrap and deployment orchestration slice:
It ties the first slices together and documents the repo workflow around them.