# Ticket #000023 — 5S Phase 1b: Syllogism, Synthesis, Semiotics (carrier-aware)

**Status:** closed · landed 2026-05-08
**Opened:** 2026-05-07
**Revised:** 2026-05-08 (cross-modality correction folded in per
review response)
**Closed:** 2026-05-08
**Scope:** Replace the three zero-task stubs in 5S
(Syllogism / Synthesis / Semiotics) with deterministic Phase-1b
runners + fixture sets. Implementation stays text / claim-lattice /
prose only; **the fixture schema is carrier-aware** so future
phases can attach visual, world-model, code, audio, sensor, and
hidden-channel-detection carriers without re-authoring the
fixture format.
**Audience:** fox + future bench authors + downstream v7-W /
multimodal work that needs 5S evaluation across non-text carriers.
**Hard constraint:** Phase 1a fixture digests stay pinned (Syntax
+ Semantics keep their `v1` digests). No schema bump, no
governance hash bump, no canonicalization-version bump. Unsupported
non-text carriers MUST fail or skip explicitly — never silently
accepted. No LLM-as-judge in any 5S runner.

**Source:** Dav1DPrometheus (BasementAGI host) — *"5Ss: Syntax,
Semantics, Syllogism, Synthesis, Semiotics."*

---

## 1. Corrected purpose

Two coupled goals:

1. **Complete the 5S battery** — three stubs become real runners
   with ≥30 deterministic fixtures each.
2. **Make 5S carrier-general** — Syntax, Semantics, Semiotics,
   Syllogism, Synthesis are not prose-only. They are tests over
   *sign-bearing representations*. Text is only the first carrier.

The architectural correction (folded in 2026-05-08):

> **Syntax hidden in visual or alternate media is still syntax.
> Meaning hidden in non-text media is still semantics. A sign
> encoded in a non-text carrier is still semiotics.**

#000023 lands text fixtures + text runners now. The fixture
**schema** must accommodate future cross-carrier work without
re-authoring.

---

## 2. Carrier-aware 5S definitions

| Sub-battery | Definition (carrier-general) |
|---|---|
| **Syntax** | Formal arrangement rules of a carrier. Text: tokens, parse, markup. Code: AST, imports, indentation. Tables: rows/columns/headers. Images: layout, regions, visual grouping. World: object relations, spatial containment, event ordering. Audio: phoneme/order structure, timing. |
| **Semantics** | Invariant meaning preserved across representation changes. Text: synonym pairs, entity equivalence. Image: a stop sign and the text "STOP" carry equivalent traffic-control meaning. Chart: an upward trend and "X increases over time" carry equivalent data semantics. World: "A inside B" represented visually, symbolically, or as coordinates. |
| **Syllogism** | Stepwise valid deduction, given premises in any carrier. Text+table: "all rows with status=active have flag=true; row X has status=active; therefore X has flag=true." Image+rule: "A is inside B; rule says objects in B have property P; therefore A has P." World: "A left of B; B left of C; therefore A left of C." |
| **Synthesis** | Assembling multiple warranted elements into a coherent derivation. Text+chart: derive a claim only when textual and chart evidence agree. Image+OCR+metadata: synthesize while flagging carrier conflict. World-state: synthesize a temporal claim from multiple state observations. |
| **Semiotics** | Interpretation of signs, symbols, labels, references, frames, conventions, aliases, sign systems. Text: AMD↔"Advanced Micro Devices", Apple-fruit vs Apple-company, Orwell-frame vs literal-geography. Visual: red octagon = stop, skull icon = hazard, watermark = provenance, QR-pattern = encoded sign system, diagram-arrow = causality/flow/dependency. Future: visual steganographic carriers where surface differs from hidden encoding. |

Phase 1b implements only **text / claim-lattice / prose** carriers.
Future-carrier hooks land via fixture metadata (§3) that the v1
runner ignores or rejects-cleanly.

---

## 3. Fixture schema (carrier-aware)

Common JSONL header per task:

```json
{
  "id": "5s-<sub>-NNN",
  "battery": "5s",
  "sub_battery": "syllogism",
  "version": "v1",

  "carrier": "text",
  "domain": "claim_lattice",
  "pi_star_ref": "claim-lattice@v1",
  "loss_report_refs": [],
  "modality_notes": "Phase 1b: text-only; future carriers may include image/code/audio/world/hidden-channel.",

  "task": { ... }
}
```

Field semantics:

| Field | Phase 1b allowed values | Future values |
|---|---|---|
| `carrier` | `text`, `claim_lattice`, `prose` | `code`, `table`, `html`, `image`, `audio`, `layout`, `world`, `mixed`, `hidden_channel` |
| `domain` | `prose`, `wikitext`, `claim_lattice` | `python_ast`, `chart`, `spatial_state`, `propositional_logic`, etc. |
| `pi_star_ref` | `wikitext-base@v1`, `claim-lattice@v1` | future π* registry keys |
| `loss_report_refs` | `[]` | optional projection-loss record refs (#000022) |

Unsupported `carrier` / `domain` values → runner fails task
explicitly with `reason="unsupported_carrier"` or skips with same
reason logged. Never silently accepted.

---

## 4. Per-sub-battery implementation

### 4.1 Syllogism

**Metric:** `step_validity_rate = valid_steps / total_steps`.

**Positive fixture:**

```json
{
  "id": "5s-syllogism-001",
  "carrier": "text",
  "domain": "claim_lattice",
  "pi_star_ref": "claim-lattice@v1",
  "premises": [
    {"claim": "All mammals are animals.", "evidence_ids": ["E1"]},
    {"claim": "All dogs are mammals.",    "evidence_ids": ["E2"]}
  ],
  "candidate_step": {
    "claim": "All dogs are animals.",
    "uses": ["E1", "E2"]
  },
  "rule": "categorical_transitivity",
  "expected": "pass"
}
```

**Negative fixture:**

```json
{
  "id": "5s-syllogism-NEG-001",
  "premises": [
    {"claim": "All dogs are animals.", "evidence_ids": ["E1"]},
    {"claim": "All cats are animals.", "evidence_ids": ["E2"]}
  ],
  "candidate_step": {
    "claim": "All animals are dogs.",
    "uses": ["E1", "E2"]
  },
  "rule": "invalid_converse",
  "expected": "fail"
}
```

**Runner behavior:** load fixture → parse premises into
claim-lattice → parse candidate step → check referenced prior
claims exist → check step is licensed by declared rule → return
pass/fail. Deterministic, no LLM judge.

### 4.2 Synthesis

**Metric:** `derivation_pass_rate = passed / total`.

**Fixture shape:**

```json
{
  "id": "5s-synthesis-001",
  "carrier": "text",
  "domain": "claim_lattice",
  "pi_star_ref": "claim-lattice@v1",
  "goal": "Derive whether the source supports the release-date claim.",
  "fact_set": [
    {"id": "F1", "text": "Back to the Future was released on July 3, 1985."},
    {"id": "F2", "text": "The film was directed by Robert Zemeckis."}
  ],
  "expected_derivation": [
    {"claim": "Back to the Future was released on July 3, 1985.", "uses": ["F1"]}
  ],
  "expected": "pass"
}
```

**Future-carrier hook:** fact-set entries may later include
non-text carriers (`carrier: "chart"`, `carrier: "image"`). v1
runner rejects them as unsupported.

**Variance control:** if a Synthesis task uses arborist's retrieval
pipeline, the fixture meta MUST pin `shard_set`, `retrieval_mode`,
and `expected_fact_ids`. Bench-maxing 5pp signal floor handles
residual noise; pinned fact IDs eliminate the largest variance
source.

### 4.3 Semiotics

**Metric:** `invariance_under_swap = invariant_passes / total`.

**Synonym-swap fixture (positive):**

```json
{
  "id": "5s-semiotics-001",
  "carrier": "text",
  "domain": "prose",
  "pi_star_ref": "wikitext-base@v1",
  "source_text": "AMD released a new GPU.",
  "swap": {
    "from": "AMD",
    "to": "Advanced Micro Devices",
    "relation_kind": "synonym"
  },
  "invariant_fields": ["entity", "predicate", "object"],
  "expected_invariant": true
}
```

**Reference-frame fixture:**

```json
{
  "id": "5s-semiotics-002",
  "source_text": "Oceania has always been at war with Eastasia.",
  "frame": "orwell_1984",
  "literal_frame_expected": false,
  "reference_frame_expected": true,
  "expected_invariant": true
}
```

**Future-carrier hook (documented in fixture, not executed in v1):**

```json
{
  "future_carrier_equivalent": {
    "carrier": "image",
    "description": "symbolic sign or visual glyph equivalent may later replace text label"
  }
}
```

**Hidden-channel safety framing.** Phase 1b does NOT generate,
hide, or recover covert messages. Future hidden-channel fixtures
MUST be framed as **defensive detection / flagging** only:

```json
{
  "carrier": "image",
  "sub_battery": "semiotics",
  "hidden_channel_expected": true,
  "task_kind": "detect_unexpected_sign_channel",
  "expected": "flag"
}
```

This keeps the benchmark defensive. The capability tested is
"can the system detect a suspicious carrier" — not "can the
system encode a covert message."

**Source policy for v1 fixtures:** Semiotics fixtures use
`concept_relations.relation_kind = 'synonym'` only. Negative
fixtures pair with non-equivalent swaps explicitly tagged.

---

## 5. Required file changes

### 5.1 New fixture files

```
bench/fixtures/5s/syllogism-v1.jsonl   # ≥30 deterministic tasks
bench/fixtures/5s/synthesis-v1.jsonl   # ≥30 deterministic tasks
bench/fixtures/5s/semiotics-v1.jsonl   # ≥30 deterministic tasks
```

Each carries the standard `_meta` head:

```json
{"_meta":{"battery":"5s","sub_battery":"syllogism","version":"v1","task_count":30}}
```

Phase 1a fixture digests (`syntax-v1.jsonl`, `semantics-v1.jsonl`)
stay pinned.

### 5.2 Runner functions

In `bench/batteries/b_5s.py`, replace stub bodies of
`run_syllogism`, `run_synthesis`, `run_semiotics`. Existing
`run_syntax`, `run_semantics`, `_runtime_digest` stay untouched.

### 5.3 Make targets

```makefile
bench-5s-syllogism:  ## 5S Syllogism (step-validity-rate)
	$(PY) -m bench.batteries.runner --battery 5s --sub syllogism \
	    --fixtures bench/fixtures/5s/syllogism-v1.jsonl

bench-5s-synthesis:  ## 5S Synthesis (derivation-pass-rate)
	$(PY) -m bench.batteries.runner --battery 5s --sub synthesis \
	    --fixtures bench/fixtures/5s/synthesis-v1.jsonl

bench-5s-semiotics:  ## 5S Semiotics (invariance-under-swap)
	$(PY) -m bench.batteries.runner --battery 5s --sub semiotics \
	    --fixtures bench/fixtures/5s/semiotics-v1.jsonl
```

The existing `bench-5s` aggregate target picks them up via
`--all` once `_DEFAULT_FIXTURES` in `runner.py` includes them.

---

## 6. Tests

Replace stub-zero parametrizations for the three sub-batteries.

Required positive coverage:

```
test_5s_syllogism_runs
test_5s_synthesis_runs
test_5s_semiotics_runs
test_5s_syllogism_fixture_digest_stable
test_5s_synthesis_fixture_digest_stable
test_5s_semiotics_fixture_digest_stable
test_5s_phase1a_digest_unchanged           # guard against regression
```

Modality-safety tests (carrier-schema future-readiness):

```
test_5s_fixture_accepts_carrier_metadata
test_5s_text_runner_rejects_unsupported_nontext_carrier_cleanly
test_5s_semiotics_synonym_swap_preserves_invariant_fields
test_5s_semiotics_bad_swap_fails
```

The last group enforces that the schema accepts carrier metadata
today even though only text is executed.

---

## 7. Out of scope

- Cross-domain π* composition for 5S (covered by ticket #000015,
  already landed).
- Multimodal 5S execution (depends on #000013 spatial-temporal
  substrate + π* image / audio / world canonicalizers; future
  tickets).
- 5T Phase 1b (ticket #000024).
- 5F battery (ticket #000025).
- 5R battery — depends on SelfModel (#000014, landed) +
  memory_root (#000017, landed); reserved as Phase 2 of #000021.
- Cross-corpus expansion (Phase 3 of #000021).
- Hidden-channel **generation** or **concealment** tooling.
  Detection-only is the boundary.

---

## 8. Risks & mitigations

| Risk | Mitigation |
|---|---|
| Syllogism overfits to toy chains | Pull from ≥3 different test-source families; include invalid converses, missing-premise, unsupported-evidence-pointer failures. |
| Semiotics swaps accidentally change meaning | Use only `concept_relations.relation_kind='synonym'` for v1 positives; include explicit non-equivalent negative swaps. |
| Synthesis retrieval variance | Pin `shard_set` + `retrieval_mode` + `expected_fact_ids` in fixture meta; compare derivation shape, not exact prose. |
| Premature multimodal scope creep | Carrier metadata in fixtures; non-text carriers rejected cleanly in v1; multimodal execution deferred to #000013 / #000015 follow-ups. |
| Steganography → dual-use tooling | v1 does not generate, hide, or recover covert messages. Future fixtures framed as defensive detection / flagging. |

---

## 9. Closure criterion

#000023 closes when:

1. `run_syllogism`, `run_synthesis`, `run_semiotics` are all non-stub.
2. Each ships ≥30 deterministic fixtures with stable `fixture_digest`.
3. Fixtures include `carrier` / `domain` / `pi_star_ref` /
   `loss_report_refs` / `modality_notes` fields.
4. Unsupported non-text carriers fail/skip explicitly with
   `reason="unsupported_carrier"`.
5. `make bench-5s` runs all five 5S sub-batteries (Syntax,
   Semantics, Syllogism, Synthesis, Semiotics).
6. Phase 1a fixture digests (`syntax-v1.jsonl`,
   `semantics-v1.jsonl`) unchanged.
7. No schema, governance hash, or canonicalization-version changes.
8. Tests cover runner execution, fixture-digest stability, and
   carrier-schema future-readiness.

---

## 10. Status

**Open · awaiting go/no-go.** Three sub-batteries × ~30 fixtures
× one runner each ≈ 800-1000 lines code + fixtures. Mid-sized
session.

The architectural correction from the 2026-05-08 review:
**Semiotics, Syntax, and Semantics are defined over sign-bearing
carriers, not just written language.** Phase 1b ships the text
implementation; the fixture schema preserves the future path
into spatial-temporal world models, multimodal AGI evaluation,
and defensive hidden-channel detection.
