Phase 3: System Selection & Environment Configuration
You are translating a conceptual taxonomy into a concrete environment. The
phase-2-taxonomy-model.md defines what the substrate IS conceptually; your job is to choose the
mechanism that will hold it, build the schema into that mechanism, and seat validation rules so
non-compliant items are rejected at entry.
Preconditions
<working-dir>/substrate-context.md exists.
<working-dir>/phase-1-landscape-report.md exists (for scale and friction context).
<working-dir>/phase-2-taxonomy-model.md exists and has passed gate 2.
- Read all three files in full before starting.
Four work streams
Stream 1 — Translate Requirements
Convert the taxonomy model into objective, measurable technical criteria. For each criterion:
- Name — short label
- Source — which part of phase 1 or phase 2 this comes from
- Type — capacity / performance / integration / governance / cost / operational
- Threshold — minimum acceptable value (be quantitative; "fast enough" is not a threshold)
- Weight — importance relative to other criteria (e.g., must-have / should-have / nice-to-have)
Example criterion families to consider:
- Scale (entity count, write rate, storage volume, growth projection)
- Query patterns (point lookups, range scans, joins, full-text, vector similarity)
- Concurrency (simultaneous readers/writers, lock contention tolerance)
- Schema flexibility (rigid vs. evolutive, online migration support)
- Access control granularity (row/column/field-level, attribute-based)
- Audit requirements (immutable log, point-in-time recovery, retention)
- Integration surface (API protocols, webhook support, CDC, MCP-compatibility)
- Operational fit (existing team skill, hosting model, total cost of ownership)
- Compliance posture (data residency, encryption-at-rest, certification)
Aim for 8–20 criteria. Fewer means you'll have a weak basis to decide on. More means you're
chasing decoration over deciding.
Stream 2 — Evaluate Mechanisms
Benchmark candidate engines or frameworks against the criteria.
For each candidate (typically 2–4):
- Name + version
- Category — relational DB / document store / graph / object storage / CMS / repo /
spreadsheet / specialized SaaS / custom
- Scoring — for each criterion, score "meets / partial / fails" with a brief rationale
- Total cost — license, infrastructure, operational time, integration cost
- Lock-in risk — how reversible is the choice if it turns out wrong
- Existing-substrate compatibility — how much of the current substrate can be migrated
vs. rebuilt
Pick a winner. State the decision with reasoning. Be explicit about which criteria the winner
fails or only partially meets, and what the mitigation is for each.
Stream 3 — Instantiate Architecture
Build the designed taxonomy directly into the chosen environment. Document the steps:
- Schema declarations — DDL, schema files, configuration manifests, etc., for every entity
class and universal-schema attribute from phase 2
- Relationship implementations — foreign keys, link tables, embedded documents, graph edges,
etc., one per phase-2 relationship
- Access control implementations — role/permission/policy declarations matching the phase-2
access framework
- Index strategy — what indexes exist for what query patterns
- Initial state — empty / seeded with reference data / migrated subset
Provide actual code/config (not just descriptions). The artifact should be reproducible — a new
operator should be able to instantiate the environment from this section alone.
Stream 4 — Enforce Validation Rules
Program automated checks to reject non-compliant items at entry. For each rule:
- Layer — schema-level (e.g., NOT NULL constraints) / application-level (validation
functions) / pipeline-level (ingestion checks)
- Trigger — when the rule fires (on insert, on update, on read, on schedule)
- Behavior — reject / coerce / warn / quarantine
- Failure handling — what happens to rejected items (DLQ, error log, return to sender)
Cover at minimum:
- Universal-schema attribute validation (id format, ownership existence, status enum)
- Class-specific required attribute validation
- Relationship integrity (orphan detection, cardinality enforcement)
- Access tier consistency (no items written to a tier the writer can't access)
Composing phase-3-environment-spec.md
Combine the four streams into a single file at <working-dir>/phase-3-environment-spec.md.
Structure:
# Phase 3 — Environment Spec
**Substrate:** <name>
**Date:** YYYY-MM-DD
**Preconditions:** Read substrate-context.md, phase-1-landscape-report.md, phase-2-taxonomy-model.md
**Postconditions:** Ready for Phase 4 (systemic-ingestion-normalization)
## 1. Selection criteria
[full criteria table]
## 2. Mechanism evaluation
[per-candidate scoring + decision with rationale]
## 3. Instantiation
### 3.1 Schema declarations
[code/config]
### 3.2 Relationships
[code/config]
### 3.3 Access controls
[code/config]
### 3.4 Indexes
[code/config]
### 3.5 Initial state
[empty / seeded / migrated subset]
## 4. Validation rules
[per-rule cards organized by layer]
## 5. Open questions for Phase 4
[explicit list of decisions deferred to ingestion]
Gate criteria (auditor will check)
The spec passes Phase 3's gate iff:
- At least 8 selection criteria are defined with thresholds and weights.
- At least 2 candidate mechanisms were evaluated, with explicit scoring against criteria.
- A winner is declared with explicit rationale; criteria the winner fails or partially meets
are named with mitigations.
- Schema declarations exist for every entity class from phase 2 — no class is silently
dropped during instantiation.
- Validation rules cover universal schema, class-specific requireds, relationship integrity,
and access-tier consistency at minimum.
- Open questions for Phase 4 section is present.
Anti-patterns
- Don't choose the mechanism before the criteria. Reverse-engineering criteria to fit a
pre-chosen tool defeats the phase. If a mechanism is genuinely pre-decided, document why and
short-circuit Stream 2 with a one-paragraph rationale.
- Don't silently drop entity classes. If a class doesn't fit the chosen mechanism cleanly,
surface the friction — either redesign the taxonomy or pick a different mechanism.
- Don't defer validation to "we'll add it later". Validation rules ARE the entry gate; if
they're absent at instantiation, ingestion will pollute the new environment with bad data.
- Don't skip indexes. Phase 1's value metrics (especially speed) imply specific query
patterns. Index for them now, not after performance regressions.
See also
references/selection-criteria.md — common criterion families with example thresholds
references/validation-rules.md — validation patterns by mechanism category
1---2name: system-environment-configuration3description: Phase 3 of the pentaphase structural-overhaul protocol. Translates the taxonomy model into objective technical criteria, evaluates candidate mechanisms or frameworks, instantiates the chosen architecture, and programs validation rules. Use when the user invokes phase 3 of an overhaul, asks to "select a system" or "configure the environment", or has a taxonomy model and is ready to choose technology. Consumes phase-2-taxonomy-model.md; produces phase-3-environment-spec.md.4license: MIT5---6
7# Phase 3: System Selection & Environment Configuration
8
9You are translating a conceptual taxonomy into a concrete environment. The
10`phase-2-taxonomy-model.md` defines what the substrate IS conceptually; your job is to choose the
11mechanism that will hold it, build the schema into that mechanism, and seat validation rules so
12non-compliant items are rejected at entry.
13
14## Preconditions
15
16- `<working-dir>/substrate-context.md` exists.
17- `<working-dir>/phase-1-landscape-report.md` exists (for scale and friction context).
18- `<working-dir>/phase-2-taxonomy-model.md` exists and has passed gate 2.
19- Read all three files in full before starting.
20
21## Four work streams
22
23### Stream 1 — Translate Requirements
24
25Convert the taxonomy model into objective, measurable technical criteria. For each criterion:
26
27- **Name** — short label
28- **Source** — which part of phase 1 or phase 2 this comes from
29- **Type** — capacity / performance / integration / governance / cost / operational
30- **Threshold** — minimum acceptable value (be quantitative; "fast enough" is not a threshold)
31- **Weight** — importance relative to other criteria (e.g., must-have / should-have / nice-to-have)
32
33Example criterion families to consider:
34
35- Scale (entity count, write rate, storage volume, growth projection)
36- Query patterns (point lookups, range scans, joins, full-text, vector similarity)
37- Concurrency (simultaneous readers/writers, lock contention tolerance)
38- Schema flexibility (rigid vs. evolutive, online migration support)
39- Access control granularity (row/column/field-level, attribute-based)
40- Audit requirements (immutable log, point-in-time recovery, retention)
41- Integration surface (API protocols, webhook support, CDC, MCP-compatibility)
42- Operational fit (existing team skill, hosting model, total cost of ownership)
43- Compliance posture (data residency, encryption-at-rest, certification)
44
45Aim for 8–20 criteria. Fewer means you'll have a weak basis to decide on. More means you're
46chasing decoration over deciding.
47
48### Stream 2 — Evaluate Mechanisms
49
50Benchmark candidate engines or frameworks against the criteria.
51
52For each candidate (typically 2–4):
53
54- **Name + version**
55- **Category** — relational DB / document store / graph / object storage / CMS / repo /
56 spreadsheet / specialized SaaS / custom
57- **Scoring** — for each criterion, score "meets / partial / fails" with a brief rationale
58- **Total cost** — license, infrastructure, operational time, integration cost
59- **Lock-in risk** — how reversible is the choice if it turns out wrong
60- **Existing-substrate compatibility** — how much of the current substrate can be migrated
61 vs. rebuilt
62
63Pick a winner. State the decision with reasoning. Be explicit about which criteria the winner
64fails or only partially meets, and what the mitigation is for each.
65
66### Stream 3 — Instantiate Architecture
67
68Build the designed taxonomy directly into the chosen environment. Document the steps:
69
70- **Schema declarations** — DDL, schema files, configuration manifests, etc., for every entity
71 class and universal-schema attribute from phase 2
72- **Relationship implementations** — foreign keys, link tables, embedded documents, graph edges,
73 etc., one per phase-2 relationship
74- **Access control implementations** — role/permission/policy declarations matching the phase-2
75 access framework
76- **Index strategy** — what indexes exist for what query patterns
77- **Initial state** — empty / seeded with reference data / migrated subset
78
79Provide actual code/config (not just descriptions). The artifact should be reproducible — a new
80operator should be able to instantiate the environment from this section alone.
81
82### Stream 4 — Enforce Validation Rules
83
84Program automated checks to reject non-compliant items at entry. For each rule:
85
86- **Layer** — schema-level (e.g., NOT NULL constraints) / application-level (validation
87 functions) / pipeline-level (ingestion checks)
88- **Trigger** — when the rule fires (on insert, on update, on read, on schedule)
89- **Behavior** — reject / coerce / warn / quarantine
90- **Failure handling** — what happens to rejected items (DLQ, error log, return to sender)
91
92Cover at minimum:
93
94- Universal-schema attribute validation (id format, ownership existence, status enum)
95- Class-specific required attribute validation
96- Relationship integrity (orphan detection, cardinality enforcement)
97- Access tier consistency (no items written to a tier the writer can't access)
98
99## Composing phase-3-environment-spec.md
100
101Combine the four streams into a single file at `<working-dir>/phase-3-environment-spec.md`.
102Structure:
103
104```markdown
105# Phase 3 — Environment Spec
106
107**Substrate:** <name>
108**Date:** YYYY-MM-DD
109**Preconditions:** Read substrate-context.md, phase-1-landscape-report.md, phase-2-taxonomy-model.md
110**Postconditions:** Ready for Phase 4 (systemic-ingestion-normalization)
111
112## 1. Selection criteria
113
114[full criteria table]
115
116## 2. Mechanism evaluation
117
118[per-candidate scoring + decision with rationale]
119
120## 3. Instantiation
121
122### 3.1 Schema declarations
123[code/config]
124
125### 3.2 Relationships
126[code/config]
127
128### 3.3 Access controls
129[code/config]
130
131### 3.4 Indexes
132[code/config]
133
134### 3.5 Initial state
135[empty / seeded / migrated subset]
136
137## 4. Validation rules
138
139[per-rule cards organized by layer]
140
141## 5. Open questions for Phase 4
142
143[explicit list of decisions deferred to ingestion]
144```
145
146## Gate criteria (auditor will check)
147
148The spec passes Phase 3's gate iff:
149
1501. **At least 8 selection criteria** are defined with thresholds and weights.
1512. **At least 2 candidate mechanisms** were evaluated, with explicit scoring against criteria.
1523. **A winner is declared** with explicit rationale; criteria the winner fails or partially meets
153 are named with mitigations.
1544. **Schema declarations exist for every entity class** from phase 2 — no class is silently
155 dropped during instantiation.
1565. **Validation rules cover universal schema, class-specific requireds, relationship integrity,
157 and access-tier consistency** at minimum.
1586. **Open questions for Phase 4 section is present**.
159
160## Anti-patterns
161
162- **Don't choose the mechanism before the criteria.** Reverse-engineering criteria to fit a
163 pre-chosen tool defeats the phase. If a mechanism is genuinely pre-decided, document why and
164 short-circuit Stream 2 with a one-paragraph rationale.
165- **Don't silently drop entity classes.** If a class doesn't fit the chosen mechanism cleanly,
166 surface the friction — either redesign the taxonomy or pick a different mechanism.
167- **Don't defer validation to "we'll add it later".** Validation rules ARE the entry gate; if
168 they're absent at instantiation, ingestion will pollute the new environment with bad data.
169- **Don't skip indexes.** Phase 1's value metrics (especially speed) imply specific query
170 patterns. Index for them now, not after performance regressions.
171
172## See also
173
174- `references/selection-criteria.md` — common criterion families with example thresholds
175- `references/validation-rules.md` — validation patterns by mechanism category