diff --git a/project/v3/manuscripts/revised/04-engineering-knowledge-as-code.md b/project/v3/manuscripts/revised/04-engineering-knowledge-as-code.md index 4fd6fbf..b894b2a 100644 --- a/project/v3/manuscripts/revised/04-engineering-knowledge-as-code.md +++ b/project/v3/manuscripts/revised/04-engineering-knowledge-as-code.md @@ -72,6 +72,8 @@ When changing an established configuration, the team must identify what is actua Consider INT-CHG-001, the proposal to investigate adaptive signal selection. An engineer gives an LLM the T1 graph and asks, “If phase selection changes, which model and interface should we revisit? Identify the links that support your answer.” Suppose the assistant suggests, “Review the queue model and change the controller's command interface.” + + The engineer follows link E07 from INT-CHG-001 through `may_affect` to the phase-selection function, INT-FUN-001. To find a model of that function, she looks for an **incoming** `represents` link. The recorded T1 link, E03, reads **INT-MOD-001 → represents → INT-FUN-001**. Following it back from its target identifies the model. The engineer opens its T1 inputs and finds the assumption worth examining. The phases follow a fixed sequence even when arrivals change. E08 also records `may_affect`, this time from the change to INT-IF-001. Both E07 and E08 have the status `inferred_review_candidate`. The engineer turns “change the interface” into a question for its owner. Could the controller select a different phase using the commands the interface already defines? diff --git a/site/src/components/learning/ChangeImpactFigure.astro b/site/src/components/learning/ChangeImpactFigure.astro new file mode 100644 index 0000000..4a4a2d0 --- /dev/null +++ b/site/src/components/learning/ChangeImpactFigure.astro @@ -0,0 +1,126 @@ +--- +import graph from '../../../../project/v3/case-study/source-graph-v1.json'; + +const sourceUrl = 'https://github.com/And-Gu/executable-engineering-lab/blob/main/project/v3/case-study/source-graph-v1.json'; +const titles = { + proposal: 'Adaptive strategy proposal', function: 'Phase selection', + model: 'Two-queue model', interface: 'Command interface', +}; +const statusNames: Record = { + inferred_review_candidate: 'Inferred review candidate', + recorded_in_fictional_fixture: 'Recorded in the teaching graph', +}; +const layout = [ + { id: 'E07', axis: 'across', from: 'proposal', relation: 'may_affect', to: 'function' }, + { id: 'E03', axis: 'up', from: 'model', relation: 'represents', to: 'function' }, + { id: 'E08', axis: 'down', from: 'proposal', relation: 'may_affect', to: 'interface' }, +] as const; +const records = new Map(graph.nodes.map(node => [node.id, node])); +const links = layout.map(slot => { + const edge = graph.edges.find(edge => edge.id === slot.id); + const from = edge && records.get(edge.from); + const to = edge && records.get(edge.to); + if (!edge || !from || !to || from.kind !== slot.from || to.kind !== slot.to || + edge.relation !== slot.relation || !statusNames[edge.relation_status]) { + throw new Error(`T1 relationship ${slot.id} no longer matches the Chapter 4 figure`); + } + return { edge, from, to, slot, label: edge.relation.replaceAll('_', ' ') }; +}); +const nodes = [...new Set(links.flatMap(link => [link.from, link.to]))]; +if (nodes.length !== 4) throw new Error('The Chapter 4 relationships must share one proposal and one function'); +--- +
+

Tracing the adaptive strategy proposal

+ +
+ Select a relationship to inspect its record. +
+ {nodes.map(node =>
+ {titles[node.kind as keyof typeof titles]} + {node.id} +
)} + {links.map(({ edge, from, to, slot, label }) =>
+
+ + +
+
+
{edge.id} · {edge.asserted_in_revision} · {statusNames[edge.relation_status]}
+
{from.id} {edge.relation} {to.id}
+
+
)} +
+
+
Follow the incoming represents arrow back to the model to review its fixed phases. The interface owner can check whether the existing commands support the proposed strategy. {graph.revision} source graph
+
+ + diff --git a/site/src/data/v3-learning.test.ts b/site/src/data/v3-learning.test.ts index dd7ac99..2e21cdc 100644 --- a/site/src/data/v3-learning.test.ts +++ b/site/src/data/v3-learning.test.ts @@ -5,12 +5,14 @@ import { chapterQuizzes, chapterSections, quizSchema } from './v3-learning'; describe('V3 chapter activities', () => { it('binds the five published manuscripts to their own questions and slots', () => { + const figures: Record = { '04': 'change-impact-figure', '05': 'intersection-model' }; for (const chapter of v3Chapters.slice(0, 5)) { const slug = chapter.url.split('/').filter(Boolean).at(-1); const source = readFileSync(new URL(`../../../project/v3/manuscripts/revised/${slug}.md`, import.meta.url), 'utf8'); const id = source.match(/^id: (.+)$/m)![1]; expect(chapterQuizzes.get(id)?.length).toBeGreaterThanOrEqual(2); - const activities = chapter.number === '05' ? ['intersection-model', 'chapter-quiz'] : ['chapter-quiz']; + const figure = figures[chapter.number]; + const activities = figure ? [figure, 'chapter-quiz'] : ['chapter-quiz']; expect(chapterSections(source, activities).filter(part => part.kind === 'activity').map(part => part.content)).toEqual(activities); } }); diff --git a/site/src/pages/learn/v3/[slug].astro b/site/src/pages/learn/v3/[slug].astro index 5ff398a..cce3ffd 100644 --- a/site/src/pages/learn/v3/[slug].astro +++ b/site/src/pages/learn/v3/[slug].astro @@ -3,6 +3,7 @@ import type { MarkdownInstance } from 'astro'; import { v3Chapters } from '../../../data/v3-course'; import { chapterQuizzes, chapterSections } from '../../../data/v3-learning'; import ChapterQuiz from '../../../components/learning/ChapterQuiz.astro'; +import ChangeImpactFigure from '../../../components/learning/ChangeImpactFigure.astro'; import QueueExperiment from '../../../components/learning/QueueExperiment.astro'; import SocialLinks from '../../../components/SocialLinks.astro'; import AuthorAttribution from '../../../components/AuthorAttribution.astro'; @@ -32,6 +33,7 @@ const base = import.meta.env.BASE_URL; const headings = getHeadings().filter((h: {depth:number}) => h.depth === 2); const questions = chapterQuizzes.get(frontmatter.id); const activities = ['chapter-quiz']; +if (frontmatter.id === 'eel-v3-ch04-engineering-knowledge') activities.push('change-impact-figure'); if (frontmatter.id === 'eel-v3-ch05-models-prototypes') activities.push('intersection-model'); const sections = questions ? chapterSections(await chapter.compiledContent(), activities) @@ -51,6 +53,7 @@ const sourceUrl = `https://github.com/And-Gu/executable-engineering-lab/blob/mai
{questions ? sections.map(section => { if (section.kind === 'prose') return ; + if (section.content === 'change-impact-figure') return ; if (section.content === 'intersection-model') return ; return ; }) : }