Skip to content

Commit a971f48

Browse files
committed
Add developer methodology guides and project coder lexicon
1 parent 3ebd35e commit a971f48

File tree

5 files changed

+240
-0
lines changed

5 files changed

+240
-0
lines changed

advanced_cnc_copilot/FEATURE_IMPLEMENTATION_BLUEPRINT.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,9 @@ This blueprint follows documentation conventions commonly used in mature industr
171171
- **Lifecycle clarity**: includes implementation sequence, DoD, and immediate actions.
172172

173173
For low-level operational and contract details, see `docs/TECHNICAL_REFERENCE.md`.
174+
175+
Contributor workflow docs:
176+
- `docs/DEVELOPER_EDITING_GUIDE.md`
177+
- `docs/METHODOLOGY_OF_ANALOGY.md`
178+
- `docs/CODER_LEXICON.md`
179+

advanced_cnc_copilot/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ A three-agent system ensuring safe AI integration:
146146
- `SYSTEM_ARCHITECTURE.md`: architecture and data-flow map.
147147
- `FEATURE_IMPLEMENTATION_BLUEPRINT.md`: roadmap-driven delivery blueprint.
148148
- `docs/TECHNICAL_REFERENCE.md`: production-style technical contracts, NFRs, safety and release criteria.
149+
- `docs/DEVELOPER_EDITING_GUIDE.md`: safe code editing workflow and PR checklist.
150+
- `docs/METHODOLOGY_OF_ANALOGY.md`: analogy methodics and validation protocol.
151+
- `docs/CODER_LEXICON.md`: canonical project vocabulary for consistent implementation language.
149152

150153
## Delivery Blueprint (Roadmap -> Execution)
151154

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Coder Lexicon
2+
3+
A shared vocabulary for contributors. Use these terms consistently in code, docs, and PRs.
4+
5+
## A
6+
7+
- **Action Trace**: Ordered list of actions proposed/applied during a scenario.
8+
- **Auditor Verdict**: Deterministic pass/fail decision on a proposed action set.
9+
10+
## B
11+
12+
- **Blueprint Track**: A feature workstream in `FEATURE_IMPLEMENTATION_BLUEPRINT.md`.
13+
- **Boundary Validation**: Input normalization and schema checks at API/WS edges.
14+
15+
## C
16+
17+
- **Creator**: Agent that proposes strategies or mutations.
18+
- **Contract Field**: A payload field with defined semantics and compatibility expectations.
19+
20+
## D
21+
22+
- **Decision Packet**: Structured unit containing proposal, scores, and reasoned decision.
23+
- **Deterministic Safety Gate**: Hard constraint layer that blocks unsafe actions.
24+
25+
## E
26+
27+
- **Execution Plane**: HAL/hardware/simulator domain where commands become physical effects.
28+
29+
## F
30+
31+
- **Fallback Stream**: Global websocket stream (`/ws/telemetry`) used if machine-scoped stream is unavailable.
32+
33+
## H
34+
35+
- **HAL**: Hardware Abstraction Layer connecting software to CNC hardware/simulator.
36+
- **Hub**: Dashboard entry view linking operational and fleet pages.
37+
38+
## I
39+
40+
- **Interface Layer**: HTTP/WebSocket layer; translation only, minimal logic.
41+
42+
## L
43+
44+
- **Lexicon Term**: Canonical project term expected to remain stable across docs.
45+
46+
## M
47+
48+
- **Machine-Scoped Stream**: WebSocket endpoint `/ws/telemetry/{machine_id}`.
49+
- **Methodics**: Repeatable procedural method for implementing or validating a concept.
50+
51+
## N
52+
53+
- **NFR**: Non-Functional Requirement (reliability, performance, security, observability).
54+
55+
## O
56+
57+
- **Operational Readiness**: State where monitoring, safety, and runbook criteria are met.
58+
59+
## P
60+
61+
- **Preference Pair**: LLM training sample comparing good vs bad plan.
62+
- **Primary Path**: Preferred runtime path before fallback logic.
63+
64+
## R
65+
66+
- **Reason Code**: Machine-readable explanation for pass/fail/block decisions.
67+
- **Rollback Trigger**: Condition requiring reversion to safer prior behavior.
68+
69+
## S
70+
71+
- **Shadow Mode**: Recommendation-only deployment with no autonomous execution.
72+
- **Shadow Council**: Creator + Auditor + Accountant decision framework.
73+
74+
## T
75+
76+
- **Telemetry Window**: Time-series slice used for decision and training.
77+
- **Traceability Crosswalk**: Mapping from roadmap source docs to implementation tracks.
78+
79+
## U
80+
81+
- **Upgrade Safety**: Principle of additive/compatible changes in contracts.
82+
83+
## V
84+
85+
- **Validation Gate**: Any explicit checkpoint that must pass before progression.
86+
87+
## W
88+
89+
- **Workstream**: Cohesive implementation track with acceptance criteria.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Developer Editing Guide
2+
3+
This guide explains **how to safely edit code in FANUC RISE** while preserving architecture, safety, and documentation standards.
4+
5+
## 1) Working Agreement (before editing)
6+
7+
1. Identify the layer you are touching:
8+
- **Repository/Data layer**: storage access only.
9+
- **Service layer**: business logic and domain rules.
10+
- **Interface layer**: HTTP/WebSocket translation only.
11+
- **HAL layer**: hardware/simulator interaction.
12+
2. Keep changes scoped to one concern per commit.
13+
3. If behavior changes, update documentation in the same PR.
14+
4. Safety logic must remain deterministic and explicit.
15+
16+
## 2) Standard Edit Workflow
17+
18+
### Step 1 — Locate ownership
19+
- Confirm which module owns behavior before changing anything.
20+
- Avoid adding logic to transport/controller files when it belongs in services.
21+
22+
### Step 2 — Make minimal delta
23+
- Prefer focused edits over broad refactors.
24+
- Preserve public contracts unless explicitly versioning them.
25+
26+
### Step 3 — Validate locally
27+
- Syntax check changed language files.
28+
- Run basic smoke checks for impacted entrypoints.
29+
- Verify machine-scoped and fallback telemetry paths if touching dashboard/ws code.
30+
31+
### Step 4 — Document and annotate
32+
- Update one of:
33+
- `README.md` (entry-level impact)
34+
- `SYSTEM_ARCHITECTURE.md` (flow/architecture impact)
35+
- `docs/TECHNICAL_REFERENCE.md` (contract/NFR impact)
36+
37+
## 3) Editing Rules by Layer
38+
39+
### Interface Layer (FastAPI/WS/UI)
40+
- Keep handlers thin; no hidden business rules.
41+
- Validate and normalize inputs at boundaries.
42+
- Include reason codes for safety-relevant outcomes.
43+
44+
### Service Layer
45+
- Keep deterministic policy checks explicit and testable.
46+
- Separate AI proposal generation from safety decision logic.
47+
48+
### HAL Layer
49+
- Use circuit breakers and bounded retries.
50+
- Always provide simulator fallback path for non-hardware environments.
51+
52+
### Data Layer
53+
- Keep schema evolution backward-compatible where possible.
54+
- Prefer additive migration strategy for minor versions.
55+
56+
## 4) Pull Request Checklist for Editors
57+
58+
- [ ] Change is scoped and explained.
59+
- [ ] Contracts impacted are documented.
60+
- [ ] Safety model unchanged or explicitly strengthened.
61+
- [ ] Bootstrap/runbook instructions still valid.
62+
- [ ] Feature blueprint or roadmap mapping updated (if relevant).
63+
64+
## 5) Anti-Patterns to Avoid
65+
66+
- Embedding domain logic in route/controller files.
67+
- Treating LLM confidence as a safety gate.
68+
- Adding hardcoded hostnames/ports where runtime-derived config is needed.
69+
- Changing websocket payload shape without documenting compatibility implications.
70+
71+
## 6) Recommended Commit Style
72+
73+
Use intent-first commit messages:
74+
- `harden ws fallback for machine-scoped telemetry`
75+
- `document api reason_code contract for auditor decisions`
76+
- `refactor service-layer policy checks into deterministic validator`
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Methodology of Analogy
2+
3+
This project uses analogy as a **design reasoning method** (not as proof). The goal is to convert complex systems into understandable engineering decisions while keeping validation deterministic.
4+
5+
## 1) Why analogy is used
6+
7+
Manufacturing intelligence spans hardware, data systems, and decision engines. Analogy helps teams:
8+
- communicate intent across disciplines,
9+
- reason about architecture boundaries,
10+
- teach concepts quickly,
11+
- preserve a shared mental model.
12+
13+
## 2) Core rule: Analogy guides design, metrics validate design
14+
15+
- Analogy can propose a model.
16+
- Tests, telemetry, and safety constraints accept or reject the model.
17+
18+
## 3) Reusable analogy patterns in this repo
19+
20+
### A) Nervous System Analogy
21+
- Interface layer = sensory nerves.
22+
- Service layer = brain processing.
23+
- HAL = motor/physical actuation.
24+
- Use when deciding where logic belongs.
25+
26+
### B) Shadow Council Analogy
27+
- Creator = proposal engine.
28+
- Auditor = deterministic law.
29+
- Accountant = trade-off scorer.
30+
- Use when implementing safe AI workflow.
31+
32+
### C) Economic Translation Analogy
33+
- SaaS metrics (churn/CAC) mapped to manufacturing costs/risks.
34+
- Use for optimization and reporting semantics.
35+
36+
## 4) Analogy-to-Implementation Protocol
37+
38+
1. **Name the analogy** (e.g., "nervous system").
39+
2. **Map entities to concrete modules**.
40+
3. **Define constraints that cannot be violated**.
41+
4. **Define measurable outcomes**.
42+
5. **Run simulation or controlled validation**.
43+
6. **Accept/reject based on evidence**.
44+
45+
## 5) Failure modes and mitigations
46+
47+
- **Failure mode**: treating metaphor as implementation detail.
48+
- **Mitigation**: maintain explicit contracts and tests.
49+
- **Failure mode**: analogy drift across teams.
50+
- **Mitigation**: use shared lexicon and architecture docs.
51+
- **Failure mode**: narrative over safety.
52+
- **Mitigation**: deterministic policy layer always precedes execution.
53+
54+
## 6) Example conversion template
55+
56+
Use this template when introducing a new analogy:
57+
58+
- Analogy name:
59+
- Problem it clarifies:
60+
- Module mapping:
61+
- Hard constraints:
62+
- Success metrics:
63+
- Validation plan:
64+
- Rollback criteria:
65+
66+
This keeps analogy usage operational, measurable, and safe.

0 commit comments

Comments
 (0)