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>
25 KiB
Map Economic Entities to VSM Concepts
You are a systems theorist specializing in Stafford Beer's Viable System Model. Your task is to map extracted economic entities to VSM concepts.
Extracted Entities
--- ENTITY: division-of-labour ---
Division of Labour
Definition
The separation of a work process into a number of distinct tasks, each performed by a specialised worker, resulting in a significant increase in the productive powers of labour. Smith identifies it as the principal cause of improvement in the productive capacity of any trade, art, or manufacture. The effect arises from three circumstances: increased dexterity, saved time in transition between tasks, and the invention of labour-saving machinery.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
The division of labour is the central argument of the chapter. Smith opens by asserting that it is the greatest source of improvement in productive powers, then illustrates it through the pin-factory example, explains its three causal mechanisms, and concludes by showing how it generates universal opulence through exchange.
Economic Domain
Production
Smith's Original Wording
"The greatest improvements in the productive powers of labour, and the greater part of the skill, dexterity, and judgment, with which it is anywhere directed, or applied, seem to have been the effects of the division of labour."
Modern Interpretation
The division of labour remains a foundational concept in economics and organisational theory. Modern extensions include specialisation theory, comparative advantage (Ricardo), and the study of transaction costs that determine the boundaries between internal division and market exchange (Coase).
--- ENTITY: productive-powers-of-labour ---
Productive Powers of Labour
Definition
The capacity of human labour to produce output, measured in terms of the quantity and quality of goods a given number of workers can produce within a given time. Smith argues that the division of labour is the primary cause of increases in productive power, and that differences in productive power explain differences in national wealth.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Smith introduces productive powers as the dependent variable that the division of labour improves. He contrasts the output of an unskilled individual worker (one pin per day) with the output of a coordinated team under division of labour (4,800 pins per person per day) to demonstrate the scale of improvement.
Economic Domain
Production
Smith's Original Wording
"This great increase in the quantity of work, which, in consequence of the division of labour, the same number of people are capable of performing, is owing to three different circumstances."
--- ENTITY: dexterity-of-the-workman ---
Dexterity of the Workman
Definition
The skill and speed a worker acquires through repeated performance of a single specialised operation. Smith identifies the increase in dexterity as the first of three causes by which the division of labour improves productive power. Specialisation reduces each worker's task to one simple operation, making it the sole employment of their life, and thereby dramatically increasing their proficiency.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Presented as the first of three mechanisms explaining why the division of labour increases output. Smith illustrates it with the example of nail-making: an unskilled smith makes 200-300 nails per day, while a specialised nailer can produce over 2,300.
Economic Domain
Production
Smith's Original Wording
"First, the improvement of the dexterity of the workmen, necessarily increases the quantity of the work he can perform; and the division of labour, by reducing every man's business to some one simple operation, and by making this operation the sole employment of his life, necessarily increases very much the dexterity of the workman."
--- ENTITY: saving-of-time ---
Saving of Time
Definition
The elimination of time lost when a worker passes from one kind of work to another. Smith identifies this as the second mechanism by which the division of labour increases productive power. Time is lost both in physical transition (moving between locations and tools) and in mental transition (the sauntering and inattention that follows switching tasks).
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Presented as the second of three mechanisms. Smith argues the loss is greater than commonly supposed, encompassing not only travel time but a psychological cost: workers who constantly switch tasks develop habits of "sauntering" and "indolent careless application" that reduce their output even during active work.
Economic Domain
Production
Smith's Original Wording
"Secondly, the advantage which is gained by saving the time commonly lost in passing from one sort of work to another, is much greater than we should at first view be apt to imagine it."
--- ENTITY: invention-of-machinery ---
Invention of Machinery
Definition
The development of machines that facilitate and abridge labour, enabling one person to do the work of many. Smith identifies this as the third mechanism by which the division of labour increases productive power, and argues that the division of labour itself stimulates invention, because workers focused on a single operation naturally discover improvements to their specific task.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Presented as the third mechanism. Smith provides the anecdote of the boy who automated the valve on a fire engine to free himself for play. He extends the argument beyond workers to include machine-makers and philosophers (men of speculation), whose own specialised observation enables them to combine knowledge from distant fields.
Economic Domain
Production
Smith's Original Wording
"Thirdly, and lastly, everybody must be sensible how much labour is facilitated and abridged by the application of proper machinery. It is unnecessary to give any example."
--- ENTITY: separation-of-trades ---
Separation of Trades
Definition
The process by which distinct occupations emerge as separate specialisations, each performed by dedicated practitioners rather than by a single person who performs all tasks. Smith presents the separation of trades as both a consequence and an indicator of the division of labour, noting that it advances furthest in the most industrious and improved countries.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Smith transitions from the pin-factory example to the economy-wide observation that in improved societies, "the farmer is generally nothing but a farmer; the manufacturer, nothing but a manufacturer." He contrasts manufacturing, where trades separate extensively, with agriculture, where seasonal demands prevent full separation.
Economic Domain
Production
Smith's Original Wording
"The separation of different trades and employments from one another, seems to have taken place in consequence of this advantage."
--- ENTITY: the-workman ---
The Workman
Definition
The individual labourer who performs productive work, whether in manufacturing or agriculture. In the context of the division of labour, the workman is the operative unit whose dexterity, time, and inventiveness are the channels through which specialisation increases output. Smith portrays the workman both as a beneficiary of the division of labour (higher output) and as its agent (inventing machinery through focused attention).
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
The workman appears throughout the chapter as the primary actor: the pin-maker, the nailer, the country weaver, the boy at the fire engine. Smith attributes both the productive gains and many mechanical inventions to ordinary workmen.
Economic Domain
Production
--- ENTITY: the-philosopher ---
The Philosopher
Definition
A person whose occupation is observation and speculation rather than direct production — "men of speculation, whose trade it is not to do any thing, but to observe every thing." Smith treats the philosopher as an economic actor whose specialised function is combining knowledge from diverse fields to produce innovations and improvements, analogous to how the workman improves their own narrow task.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Introduced near the end of Smith's discussion of the third mechanism (invention of machinery). Smith notes that as society progresses, philosophy itself becomes a specialised trade, subdivided into branches, with each philosopher becoming expert in their field — the division of labour applied to intellectual work.
Economic Domain
General Theory
Smith's Original Wording
"In the progress of society, philosophy or speculation becomes, like every other employment, the principal or sole trade and occupation of a particular class of citizens."
--- ENTITY: universal-opulence ---
Universal Opulence
Definition
The general material well-being that extends across all ranks of society, including the lowest, as a consequence of the division of labour and the resulting multiplication of production. Smith argues that through exchange, every workman can supply others abundantly with their specialised product and receive in return the products of others' specialisation, creating a "general plenty" that benefits even the poorest members of a civilised society.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
The concluding argument of the chapter. Smith illustrates universal opulence by examining the "accommodation of the most common artificer or daylabourer," showing that even a coarse woollen coat requires the cooperation of shepherds, wool-combers, dyers, weavers, merchants, sailors, and many others — a vast chain of interdependent labour that would be impossible without specialisation and exchange.
Economic Domain
Distribution
Smith's Original Wording
"It is the great multiplication of the productions of all the different arts, in consequence of the division of labour, which occasions, in a well-governed society, that universal opulence which extends itself to the lowest ranks of the people."
--- ENTITY: exchange ---
Exchange
Definition
The act of trading one's surplus production for the goods produced by others. Smith presents exchange as the mechanism by which the division of labour translates into universal opulence: each workman disposes of their surplus output and receives in return the surplus of others, so that all are supplied beyond what any individual could produce alone.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Exchange appears in the chapter's conclusion as the connecting mechanism between specialised production and general welfare. Smith implicitly treats it as prerequisite to the division of labour (explored further in Chapter 2), since specialisation only benefits workers if they can trade their surplus.
Economic Domain
Exchange
Smith's Original Wording
"Every workman has a great quantity of his own work to dispose of beyond what he himself has occasion for; and every other workman being exactly in the same situation, he is enabled to exchange a great quantity of his own goods for a great quantity or, what comes to the same thing, for the price of a great quantity of theirs."
--- ENTITY: co-operation-of-labour ---
Co-operation of Labour
Definition
The interdependent collaboration of many workers across different trades and locations to produce a single finished good. Smith demonstrates that even the simplest consumer goods in a civilised society require the combined efforts of thousands of workers — shepherds, miners, sailors, smiths, weavers — who collectively make possible what no individual could achieve alone.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Smith's extended example of the day-labourer's woollen coat serves to illustrate the vast scope of co-operation. He traces the supply chain from raw materials through manufacture and transport to show that civilised consumption depends on an immense network of specialised, interdependent labour.
Economic Domain
Production
Smith's Original Wording
"Without the assistance and co-operation of many thousands, the very meanest person in a civilized country could not be provided, even according to, what we very falsely imagine, the easy and simple manner in which he is commonly accommodated."
--- ENTITY: manufactures ---
Manufactures
Definition
The sector of production in which raw materials are transformed into finished goods through a series of distinct operations, each typically performed by specialised workers. Smith contrasts manufactures with agriculture, noting that the former admits of far greater subdivision of labour and separation of trades, and therefore exhibits far greater improvements in productive power.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Manufactures serve as the primary setting for Smith's analysis of the division of labour. The pin factory is a manufacture; so are the linen, woollen, and hardware trades he references. Smith uses the greater divisibility of manufacturing work to explain why rich countries excel more conspicuously over poor countries in manufactures than in agriculture.
Economic Domain
Production
--- ENTITY: agriculture ---
Agriculture
Definition
The sector of production concerned with the cultivation of land and the raising of crops and livestock. Smith argues that agriculture does not admit of as many subdivisions of labour as manufactures, because seasonal rhythms prevent workers from specialising year-round in a single task. As a result, agricultural productivity improves less dramatically with the division of labour than manufacturing productivity.
Source Chapter
Book I, Chapter 1: "Of the Division of Labour"
Context
Agriculture is introduced as a counterpoint to manufactures. Smith notes that the ploughman, harrower, sower, and reaper are often the same person, and that this is why even rich countries do not surpass poor countries in agricultural output as dramatically as in manufacturing output.
Economic Domain
Production
Smith's Original Wording
"The nature of agriculture, indeed, does not admit of so many subdivisions of labour, nor of so complete a separation of one business from another, as manufactures."
VSM Framework Reference
id: vsm-framework name: vsm_framework artifact_type: content description: Stafford Beer's Viable System Model reference for economic analysis version: 1.0.0
Stafford Beer's Viable System Model (VSM)
The Viable System Model (VSM) is a model of the organisational structure of any autonomous system capable of producing itself. It was created by management cybernetician Stafford Beer in his books Brain of the Firm (1972) and The Heart of Enterprise (1979).
Core Principle: Viability
A viable system is any system organised in such a way as to meet the demands of surviving in a changing environment. One of the prime features of systems that survive is that they are adaptable. The VSM expresses a model for a viable system, which is an abstracted cybernetic description applicable to any organisation that is a going concern.
The Five Systems
System 1 (S1) — Operations
The primary activities that produce the organisation's purpose. These are the operational units that directly create value. Each operational element is itself a viable system (the principle of recursion).
In economic terms: Productive enterprises, factories, farms, workshops, individual labourers performing specialised tasks, merchant operations.
Key properties: Autonomy within constraints, self-organisation, direct engagement with the environment.
System 2 (S2) — Coordination
The information channels and bodies that allow the primary activities in System 1 to communicate with each other and that allow System 3 to monitor and coordinate activities. System 2 dampens oscillations and resolves conflicts between operational units.
In economic terms: Market price mechanisms, trade customs, standard weights and measures, commercial law, banking clearinghouses, trade guilds.
Key properties: Anti-oscillatory, dampening, scheduling, conflict resolution, standardisation.
System 3 (S3) — Control / Operational Management
The structures and controls that establish the rules, resources, rights, and responsibilities of System 1 and provide an interface between Systems 1 and Systems 4/5. System 3 represents the day-to-day control of the organisation. It optimises the internal environment.
In economic terms: Government regulation of trade, taxation policy, labour laws, enforcement of contracts, the "invisible hand" as emergent internal regulation, guilds and corporations governing members.
Key properties: Internal regulation, resource allocation, accountability, synergy extraction, performance management.
System 3* (S3*) — Audit / Monitoring
The audit and monitoring channel that allows System 3 to verify information coming from System 1 through channels other than those provided by System 2. System 3* provides sporadic, direct access to operational reality.
In economic terms: Market inspections, quality checks, auditing of accounts, surprise investigations into trade practices, verification of weights and measures.
Key properties: Sporadic direct investigation, reality checking, bypassing normal reporting channels.
System 4 (S4) — Intelligence / Adaptation
The bodies and processes that look outward to the environment to monitor how the organisation needs to adapt to remain viable. System 4 captures all relevant information about the outside-and-then environment. It is responsible for strategic responses.
In economic terms: Foreign intelligence about trade opportunities, market research, new technology adoption, colonial exploration and trade route development, understanding of foreign economic systems.
Key properties: Environmental scanning, future orientation, strategic planning, modelling, research and development.
System 5 (S5) — Policy / Identity
The policy-making body that balances demands from Systems 3 and 4 and defines the identity, values, and purpose of the organisation. System 5 provides closure to the whole system and represents its supreme authority.
In economic terms: Sovereign authority, constitutional principles governing economic policy, national economic identity, the philosophical foundations of economic systems (mercantilism vs. free trade), the overarching purpose of the commonwealth.
Key properties: Identity, ethos, supreme command, policy closure, balancing internal and external perspectives.
Key Concepts
Recursion
Every viable system contains and is contained in a viable system. The same five-system structure recurs at every level of organisation. A workshop is a viable system within a factory, which is a viable system within an industry, which is a viable system within a national economy.
Variety
A measure of the number of possible states of a system. The Law of Requisite Variety (Ashby's Law) states that only variety can absorb variety. A controller must have at least as much variety as the system it controls.
Requisite Variety
The principle that for effective regulation, the variety of the regulator must match the variety of the system being regulated. This is achieved through variety attenuation (reducing the variety coming up from operations) and variety amplification (increasing the variety of management's responses).
Attenuation and Amplification
Variety engineering mechanisms. Attenuation reduces variety (e.g., reporting summaries, statistical aggregation, standardisation). Amplification increases variety (e.g., delegation, empowerment, decentralisation).
Algedonic Signals
Emergency signals that bypass the normal management hierarchy to alert higher systems of critical situations requiring immediate attention. Named from the Greek words for pain (algos) and pleasure (hedone).
In economic terms: Market panics, famine signals, sudden price collapses, trade embargoes, economic crises that demand immediate sovereign intervention.
Autonomy
The degree of freedom granted to operational units (System 1) to self-organise within constraints set by System 3. Beer argued that maximum autonomy consistent with systemic cohesion yields maximum viability.
Viability
The capacity of a system to maintain a separate existence and survive in a changing environment. A viable system continuously adapts while maintaining its identity.
Mapping Guidelines
id: mapping-rules name: mapping_rules artifact_type: content description: Guidelines for mapping economic entities to VSM concepts version: 1.0.0
VSM Mapping Rules
Mapping Principles
-
Ground in Beer's definitions. Every mapping rationale must reference the specific VSM system function, not just a superficial resemblance.
-
Prefer structural over metaphorical mappings. A mapping is strong when the economic entity performs the same functional role in Smith's economic system as the VSM component performs in an organisation.
-
Allow multiple mappings. A single economic entity may map to multiple VSM systems. For example, "the sovereign" may map to both S3 (regulation) and S5 (policy). Create separate mapping documents for each relationship.
-
Respect recursion. Consider at which level of recursion the mapping applies. The division of labour within a single workshop (S1-level) differs from the division of labour across an entire national economy (higher recursion level).
Mapping Strength Criteria
Strong
- The entity directly performs the function of the VSM system.
- The mapping would be recognisable to a VSM practitioner without explanation.
- Example: "market price mechanism" → S2 (Coordination) — prices coordinate supply and demand between producers.
Moderate
- The entity partially performs the function or performs it in a limited context.
- The mapping requires some argument but is defensible.
- Example: "merchant" → S4 (Intelligence) — merchants gather information about foreign markets, but this is not their primary function.
Weak
- The mapping is speculative or metaphorical rather than structural.
- The connection exists but requires significant interpretive work.
- Example: "moral sentiments" → S5 (Policy) — broad ethical framework shapes economic behaviour, but the connection is indirect.
What NOT to Map
- Do not force mappings where none exist. It is valid for an entity to have no clear VSM mapping — flag it with "Mapping Strength: Weak" and explain the difficulty.
- Do not map purely descriptive/historical content that lacks functional significance.
VSM System Checklist
When mapping, consider each system:
| System | Question to Ask |
|---|---|
| S1 | Does this entity directly produce value or output? |
| S2 | Does this entity coordinate between operational units? |
| S3 | Does this entity regulate internal operations? |
| S3* | Does this entity provide audit or verification? |
| S4 | Does this entity scan the environment or plan for the future? |
| S5 | Does this entity define identity, policy, or purpose? |
Also consider the key concepts:
- Recursion: At what level does this entity operate?
- Variety: Does this entity manage variety (attenuate or amplify)?
- Algedonic signals: Does this entity serve as an emergency signal?
- Autonomy: Does this entity relate to operational autonomy?
Instructions
- Review each extracted economic entity carefully.
- For each entity, determine which VSM system(s) it most closely relates to.
- Produce a mapping document for each entity-VSM relationship following the VSM Mapping Schema v1.0.
- Each mapping document must include:
- An H1 heading in the format "Entity Name -> VSM Concept Name"
- An Economic Entity Reference section
- A VSM Concept Reference section
- A Mapping Rationale section (minimum 30 words) grounded in Beer's definitions
- A Mapping Strength section rated as Strong, Moderate, or Weak
- Where an entity maps to multiple VSM systems (recursion), create separate mapping documents for each relationship.
- Flag entities that don't clearly map to any VSM concept with a "Mapping Strength: Weak" and note the difficulty in the rationale.
Output Format
Output each mapping as a separate markdown document, delimited by
--- MAPPING: <entity-name>-to-<vsm-concept> --- markers.