feat(llm): add Gemini adapter and process book-1-chapter-05

Add GeminiAdapter calling Google's Generative Language REST API
(default model: gemini-2.5-flash). Register "gemini" as third
provider in the factory and CLI. Add rate-limit retry with
exponential backoff to the pipeline's _call_llm helper. Increase
default max_tokens from 2000 to 4096.

Process book-1-chapter-05 via Gemini free tier — 1 new entity
extracted (necessaries-conveniencies-and-amusements-of-life),
41 existing entities correctly skipped by dedup. Canonical set
now at 42 unique entities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 22:54:37 +01:00
parent 2d1282a61e
commit 880c1d1374
22 changed files with 12008 additions and 57 deletions

View File

@@ -5,22 +5,50 @@ Your task is to map extracted economic entities to VSM concepts.
## Extracted Entities
--- ENTITY: Division of Labour ---
--- ENTITY: division-of-labour ---
# Division of Labour
## Definition
Division of Labour refers to the process of splitting up a task into a series of smaller tasks, each of which is performed by a specialist worker. This allows for an increase in productivity and efficiency as workers can focus on one or a few tasks where they can apply their skills, rather than having to learn and perform all tasks required to produce a good or service.
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 1, Chapter 4
Book I, Chapter 1: "Of the Division of Labour"
## Context
According to Adam Smith, the division of labour has been a fundamental aspect of economic progress. His discussion of the division of labour in this chapter is focused on the difficulties that arise when individuals specializing in different tasks need to exchange goods and services.
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
Labour Economics, Microeconomics
--- ENTITY: Commercial Society ---
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: commercial-society ---
# Commercial Society
## Definition
@@ -35,7 +63,8 @@ Smith uses the concept of a commercial society to explain the development of com
## Economic Domain
Economic Sociology, Economic History, Microeconomics
--- ENTITY: Money ---
--- ENTITY: money ---
# Money
## Definition
@@ -50,7 +79,8 @@ Smith discusses the origin and use of money. He argues that the emergence of mon
## Economic Domain
Monetary Economics, Macroeconomics
--- ENTITY: Commodity ---
--- ENTITY: commodity ---
# Commodity
## Definition
@@ -65,7 +95,8 @@ Smith discusses commodities in the context of exchange and barter, where one com
## Economic Domain
Microeconomics, Commodities Market
--- ENTITY: Barter ---
--- ENTITY: barter ---
# Barter
## Definition
@@ -80,6 +111,7 @@ Smith explains the limitations of the barter system, especially in a society whe
## Economic Domain
Economic Anthropology, Economic History, Microeconomics
## VSM Framework Reference
---

View File

@@ -0,0 +1,35 @@
--- MAPPING: Necessaries-Conveniencies-and-Amusements-of-Life-to-VSM-System-5 ---
# Necessaries, Conveniencies, and Amusements of Life -> VSM System 5 (Policy / Identity)
## Economic Entity Reference
--- ENTITY: necessaries, conveniencies, and amusements of life ---
# Necessaries, Conveniencies, and Amusements of Life
## Definition
This collective term refers to the various goods and services that individuals desire and consume to sustain and improve their well-being. Adam Smith uses it to describe the ultimate objects of human enjoyment and, by extension, what wealth enables a person to acquire. The ability to command these items, rather than merely possessing money or commodities, is presented as the true measure of a person's richness or poverty.
## Source Chapter
Book 1, Chapter 5
## Context
Introduced in the opening paragraph, this concept establishes the fundamental purpose of economic activity and the ultimate utility derived from wealth. It frames the subsequent discussion on how different
## VSM Concept Reference
### 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.
## Mapping Rationale
"Necessaries, Conveniencies, and Amusements of Life" represents the fundamental *purpose* and ultimate *goal* of the entire economic system described by Adam Smith. This aligns directly with VSM System 5, which is responsible for defining the *identity, values, and purpose* of a viable system. Just as System 5 establishes the raison d'être for an organization, these "necessaries" define *why* an economy exists and what it ultimately strives to provide for its members. They are the overarching policy objective and the measure by which the system's success (or richness/poverty) is judged.
## Mapping Strength
Strong
---

View File

@@ -0,0 +1,275 @@
# 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: necessaries, conveniencies, and amusements of life ---
# Necessaries, Conveniencies, and Amusements of Life
## Definition
This collective term refers to the various goods and services that individuals desire and consume to sustain and improve their well-being. Adam Smith uses it to describe the ultimate objects of human enjoyment and, by extension, what wealth enables a person to acquire. The ability to command these items, rather than merely possessing money or commodities, is presented as the true measure of a person's richness or poverty.
## Source Chapter
Book 1, Chapter 5
## Context
Introduced in the opening paragraph, this concept establishes the fundamental purpose of economic activity and the ultimate utility derived from wealth. It frames the subsequent discussion on how different
## 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
1. **Ground in Beer's definitions.** Every mapping rationale must reference
the specific VSM system function, not just a superficial resemblance.
2. **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.
3. **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.
4. **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
1. Review each extracted economic entity carefully.
2. For each entity, determine which VSM system(s) it most closely relates to.
3. Produce a mapping document for each entity-VSM relationship following
the VSM Mapping Schema v1.0.
4. 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
5. Where an entity maps to multiple VSM systems (recursion), create
separate mapping documents for each relationship.
6. 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.