feat(llm): add LLM integration module with OpenRouter and Claude Code adapters
Implements markitect/llm/ package with concrete LLMAdapter implementations:
- OpenRouterAdapter: HTTP via urllib with retry/backoff on 429/5xx
- ClaudeCodeAdapter: subprocess-based Claude CLI with stdin piping
- Factory pattern: create_adapter("openrouter") or create_adapter("claude-code")
- API key resolution chain: constructor > env var > project-root key file
- 42 unit tests, 2 integration tests (gated on API key / CLI availability)
Also adds the infospace-with-history example with Wealth of Nations VSM
analysis pipeline, templates, schemas, source chapters, and processed
output for chapters 1-2. process_chapters.py now supports --provider
and --model flags for automatic LLM-driven processing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,413 @@
|
||||
--- MAPPING: division-of-labour-to-s1 ---
|
||||
|
||||
# Division of Labour -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Division of Labour — the separation of a work process into distinct specialised
|
||||
tasks to increase productive power.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the organisation's
|
||||
purpose, each of which is itself a viable system.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The division of labour fundamentally defines how System 1 operational units are
|
||||
structured. By decomposing production into specialised tasks, Smith describes
|
||||
the internal architecture of operational units. Each specialised worker or
|
||||
workgroup becomes a sub-unit within S1, performing a discrete operation. The
|
||||
pin factory's eighteen distinct operations represent eighteen operational
|
||||
elements within a single S1 unit, each contributing to the factory's overall
|
||||
productive purpose. This mapping reflects Beer's principle that S1 units are
|
||||
where value is directly created through operational activity.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: division-of-labour-to-recursion ---
|
||||
|
||||
# Division of Labour -> Recursion
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Division of Labour — the separation of a work process into distinct specialised
|
||||
tasks to increase productive power.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
Recursion — the principle that every viable system contains and is contained
|
||||
in a viable system, with the same five-system structure recurring at every level.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Smith's analysis of the division of labour operates at multiple recursive
|
||||
levels simultaneously. Within the pin factory, labour is divided among ten
|
||||
workers (micro-recursion). Across society, trades separate into distinct
|
||||
occupations — farmer, manufacturer, philosopher (meso-recursion). Between
|
||||
nations, rich and poor countries specialise in different products (macro-recursion).
|
||||
This multi-level structure maps directly to Beer's recursion principle: the
|
||||
same pattern of specialisation and coordination recurs at every organisational
|
||||
level, from the individual workshop to the national economy.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: productive-powers-of-labour-to-s1 ---
|
||||
|
||||
# Productive Powers of Labour -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Productive Powers of Labour — the capacity of human labour to produce output,
|
||||
measured in terms of quantity and quality of goods per worker per unit time.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the organisation's
|
||||
purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Productive power is the measure of System 1 performance. Beer's S1 is defined
|
||||
by its capacity to produce the organisation's purpose; Smith's productive
|
||||
powers of labour quantify exactly this capacity. The 4,800-fold improvement
|
||||
in pin production under the division of labour represents a dramatic increase
|
||||
in S1 operational effectiveness. Productive power is not a system itself but
|
||||
the key performance indicator of how well S1 units function.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: dexterity-of-the-workman-to-s1 ---
|
||||
|
||||
# Dexterity of the Workman -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Dexterity of the Workman — the skill and speed acquired through repeated
|
||||
performance of a single specialised operation.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the organisation's
|
||||
purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Dexterity is a property of individual S1 operational units. As each worker
|
||||
becomes more proficient through specialisation, their operational unit
|
||||
becomes more effective at its designated function. In Beer's terms, dexterity
|
||||
represents the self-optimisation capacity of an S1 element: through practice
|
||||
and focus, the operational unit improves its own performance without external
|
||||
intervention. This aligns with Beer's principle that S1 units possess autonomy
|
||||
and self-organisation within their operational domain.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: saving-of-time-to-s2 ---
|
||||
|
||||
# Saving of Time -> System 2 (Coordination)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Saving of Time — the elimination of time lost when workers pass from one kind
|
||||
of work to another.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 2 (Coordination) — the information channels and bodies that allow
|
||||
System 1 units to communicate and coordinate, dampening oscillations.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The saving of time through specialisation is fundamentally a coordination
|
||||
gain. When workers are permanently assigned to single tasks, the need for
|
||||
coordination between tasks within one person is eliminated — there is no
|
||||
oscillation between modes of work. Smith's description of "sauntering" when
|
||||
switching tasks is precisely the kind of oscillation that System 2 is
|
||||
designed to dampen. By fixing each worker to one operation, the division
|
||||
of labour reduces the variety of coordination required, acting as a
|
||||
structural implementation of S2's anti-oscillatory function.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Moderate
|
||||
|
||||
--- MAPPING: invention-of-machinery-to-s4 ---
|
||||
|
||||
# Invention of Machinery -> System 4 (Intelligence/Adaptation)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Invention of Machinery — the development of machines that facilitate and
|
||||
abridge labour, stimulated by the focused attention of specialised workers.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 4 (Intelligence/Adaptation) — the bodies and processes that scan the
|
||||
environment and drive adaptation for continued viability.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Invention represents the adaptive capacity of the economic system. Workers
|
||||
who discover improvements to their specific operations, machine-makers who
|
||||
develop new tools, and philosophers who combine knowledge from distant
|
||||
fields all perform an S4 function: they observe the current state of
|
||||
operations, identify opportunities for improvement, and introduce innovations
|
||||
that change how S1 units operate. Smith's observation that the division of
|
||||
labour itself stimulates invention shows how S1 operational focus feeds
|
||||
into S4 intelligence — a feedback loop fundamental to Beer's model of
|
||||
adaptive viability.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: separation-of-trades-to-s1 ---
|
||||
|
||||
# Separation of Trades -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Separation of Trades — the process by which distinct occupations emerge
|
||||
as separate specialisations performed by dedicated practitioners.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the
|
||||
organisation's purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The separation of trades describes the differentiation of System 1 into
|
||||
distinct operational units. In Beer's VSM, S1 is not monolithic but
|
||||
comprises multiple semi-autonomous operational units, each with its own
|
||||
viable system structure. Smith's observation that in advanced societies
|
||||
"the farmer is generally nothing but a farmer; the manufacturer, nothing
|
||||
but a manufacturer" describes precisely this differentiation: each trade
|
||||
becomes a distinct S1 unit with its own operational domain, its own
|
||||
workers, and its own productive purpose.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: the-workman-to-s1 ---
|
||||
|
||||
# The Workman -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
The Workman — the individual labourer who performs productive work, the
|
||||
operative unit whose dexterity, time, and inventiveness are the channels
|
||||
through which specialisation increases output.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the
|
||||
organisation's purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The workman is the fundamental S1 element at the lowest level of recursion.
|
||||
Each specialised worker constitutes an operational unit that directly produces
|
||||
value. In Beer's terms, the workman at the pin factory — drawing wire,
|
||||
straightening it, cutting it — is an S1 unit within the larger S1 of the
|
||||
factory, which is itself an S1 unit within the industry. The workman embodies
|
||||
the S1 properties of autonomy (within their task domain), self-organisation,
|
||||
and direct engagement with the productive environment.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: the-philosopher-to-s4 ---
|
||||
|
||||
# The Philosopher -> System 4 (Intelligence/Adaptation)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
The Philosopher — a person whose occupation is observation and speculation,
|
||||
combining knowledge from diverse fields to produce innovations.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 4 (Intelligence/Adaptation) — the bodies and processes that look
|
||||
outward to the environment and drive adaptation.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The philosopher performs the quintessential S4 function. Their "trade is not
|
||||
to do any thing, but to observe every thing" — precisely the environmental
|
||||
scanning and intelligence-gathering role that Beer assigns to System 4.
|
||||
Philosophers combine knowledge from "the most distant and dissimilar objects,"
|
||||
integrating information across domains to produce novel understanding. This
|
||||
cross-domain synthesis is the core S4 activity: building models of the
|
||||
environment and identifying adaptive responses. Smith's observation that
|
||||
philosophy itself becomes specialised through the division of labour shows
|
||||
S4 developing its own internal S1 structure (recursion).
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: universal-opulence-to-viability ---
|
||||
|
||||
# Universal Opulence -> Viability
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Universal Opulence — the general material well-being extending to all ranks
|
||||
of society as a consequence of the division of labour and exchange.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
Viability — the capacity of a system to maintain a separate existence and
|
||||
survive in a changing environment.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Universal opulence is the emergent outcome of a viable economic system.
|
||||
Beer defines viability as the system's capacity to sustain itself; Smith's
|
||||
universal opulence demonstrates that a well-functioning economic system
|
||||
(with proper division of labour and exchange) sustains not just itself but
|
||||
all its constituent members. The fact that even the "meanest person in a
|
||||
civilized country" enjoys goods requiring the cooperation of thousands
|
||||
demonstrates systemic viability: the whole system maintains itself through
|
||||
the interdependent functioning of its parts. Viability is achieved not
|
||||
through central direction but through the self-organising properties of
|
||||
specialised, exchanging agents.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Moderate
|
||||
|
||||
--- MAPPING: exchange-to-s2 ---
|
||||
|
||||
# Exchange -> System 2 (Coordination)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Exchange — the act of trading surplus production for goods produced by
|
||||
others.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 2 (Coordination) — the information channels and bodies that allow
|
||||
System 1 units to communicate and coordinate.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Exchange is the primary coordination mechanism between specialised S1 units
|
||||
in Smith's economic system. Without exchange, the division of labour cannot
|
||||
function: workers must be able to trade their surplus for others' products.
|
||||
Exchange carries both goods and information (prices signal relative scarcity
|
||||
and demand), serving as the communication channel between operational units.
|
||||
In Beer's framework, S2 ensures that S1 units do not oscillate destructively;
|
||||
market exchange performs exactly this function by coordinating supply and demand
|
||||
across specialised producers. Exchange is the economic system's S2.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: co-operation-of-labour-to-s2 ---
|
||||
|
||||
# Co-operation of Labour -> System 2 (Coordination)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Co-operation of Labour — the interdependent collaboration of many workers
|
||||
across different trades and locations to produce a single finished good.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 2 (Coordination) — the information channels and bodies that allow
|
||||
System 1 units to communicate and coordinate.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The vast network of co-operation Smith describes — shepherds, miners, sailors,
|
||||
weavers, merchants — requires coordination mechanisms to function. No central
|
||||
authority orchestrates the production of the day-labourer's coat; instead,
|
||||
market exchange, trade customs, and commercial practice coordinate thousands
|
||||
of independent S1 units. Co-operation of labour is the observable result of
|
||||
effective S2 coordination: it demonstrates that the system's coordination
|
||||
mechanisms successfully link diverse operational units into a coherent
|
||||
productive whole.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Moderate
|
||||
|
||||
--- MAPPING: manufactures-to-s1 ---
|
||||
|
||||
# Manufactures -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Manufactures — the sector of production in which raw materials are
|
||||
transformed into finished goods through specialised operations.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the
|
||||
organisation's purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
The manufacturing sector constitutes a major S1 domain at a high level of
|
||||
recursion. Each individual manufacture (pin-making, wool-weaving, hardware
|
||||
production) is an S1 operational unit, and the sector as a whole represents
|
||||
a class of S1 activities. Smith's analysis shows that manufactures exhibit
|
||||
the highest degree of internal division of labour, meaning their S1 units
|
||||
are the most finely differentiated and therefore the most productive. This
|
||||
aligns with Beer's observation that S1 effectiveness depends on appropriate
|
||||
internal structuring.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
--- MAPPING: agriculture-to-s1 ---
|
||||
|
||||
# Agriculture -> System 1 (Operations)
|
||||
|
||||
## Economic Entity Reference
|
||||
|
||||
Agriculture — the sector of production concerned with cultivation of land
|
||||
and raising of crops and livestock.
|
||||
|
||||
## VSM Concept Reference
|
||||
|
||||
System 1 (Operations) — the primary activities that produce the
|
||||
organisation's purpose.
|
||||
|
||||
## Mapping Rationale
|
||||
|
||||
Agriculture constitutes an S1 domain that, by its nature, resists fine
|
||||
subdivision. The seasonal constraints Smith identifies — the ploughman,
|
||||
harrower, sower, and reaper must often be the same person — mean that
|
||||
agricultural S1 units cannot be as finely specialised as manufacturing ones.
|
||||
This is significant from a VSM perspective: it shows that the viability of
|
||||
S1 structures depends on environmental constraints. Agriculture's lower
|
||||
productivity gains from division of labour reflect the limits imposed on
|
||||
S1 differentiation by the natural environment.
|
||||
|
||||
## Mapping Strength
|
||||
|
||||
Strong
|
||||
|
||||
## Counter-arguments
|
||||
|
||||
Agriculture could also be mapped to S1 at a lower level of recursion (the
|
||||
individual farm), where the farmer's multiple roles (ploughing, sowing,
|
||||
reaping) represent undifferentiated S1 activities within a single viable
|
||||
system rather than distinct S1 units.
|
||||
Reference in New Issue
Block a user