Intending Topology: Project Structure Guide

Script workflow for coherence/diversity extraction, pairing, and iterative re-composition

Purpose

This guide documents the sequence used to:

Scope and document role

This guide gives a concise orientation to the pipeline sequence and the role of each stage, while the full stage-level workflow documentation is available in:


Process Overview

Step 1: Combinatorics extraction and initial measurement-space generation

Run:

What it does:

Reliability note (June 2026): the Stage 1 pass includes startup cleanup and save-retry handling so complete pair extraction matches combinatoric expectation for valid closed-path sources.

How it works:

Collects all pathItems from the Grid layer and sorts them by centroid position (top-to-bottom, left-to-right), renaming each path Grid_N. Generates all pairwise combinations (configurable for larger groupings, optionally filtered by adjacency). For each combination, combineItems() duplicates and groups the paths into a cascade layout on the Generated Vectors layer. Each group is saved as an individual .ai file via saveVectorAsDocument(), and centroid coordinates for all saved vectors are exported via exportCoordinatesCSV().

Important outputs:


Step 2: Batch process metrics and subtractive logging

Run:

What it does in active generated-vector mode:

How it works:

Reads each group from the Generated Vectors layer and duplicates it into a temporary working group in a new document. Runs two metric calculations: computeGroupMetrics() computes pairwise distances, centroid standard deviation, convex hull area, and triangle area; computeAndAttachAsymmetryMetrics() computes distance, angle, length, and area asymmetry normalised to 0–1. Each group is evaluated against configurable thresholds using the configured metricMode (options: per_metric, combined, max_pairwise). Items passing thresholds are placed in Kept_Vectors; others go to Removed_Vectors. All metric values per group are written to the log CSV.

Important outputs:

Note:


Step 3: Pair-analysis and optional visualisation data products

Run pair-analysis scripts:

03b_1_ANALYZE_PAIR_COHERENCE.jsx — ../INTENDING_TOPOLOGY_WORKFLOW/scripts/

Reads all items from the Complete layer, extracts pair keys from vector names matching the pattern (i,j), and groups instances by pair key. For each group, it builds a context signature per instance (rounded position and size), then calculates consistency as the proportion of instances sharing the most common signature. Final coherence score = consistency × 0.7 + frequency × 0.3.

03b_2_COUNT_VECTOR_FREQUENCIES.jsx — ../INTENDING_TOPOLOGY_WORKFLOW/scripts/

Reads all items from the Complete layer, matches names against the pattern Vector_N(i,j), and tallies source participation by the grid indices inside (i,j). Frequency output is therefore keyed by source grid index (for example 0..8 in a 9-source cell), not by Vector_N sequence ID.

Generated data:

Practical staging note: these files are written to Desktop by the analysis scripts, then commonly moved or copied into a per-cell coherence frequency/ folder for local reproducible runs.

Optional visualisation scripts (not required to continue the core pipeline):

03b_3_CREATE_FREQUENCY_LAYERS_3D.jsx — ../INTENDING_TOPOLOGY_WORKFLOW/scripts/

Reads vector_frequencies.json, resolves data from config.dataFolderPath first (if set), then active-document local folders, then Desktop fallback. For each source grid index, creates N copies across N layers (where N = frequency). Applies a configured visual strategy per layer (opacity fade, colour gradient, or spatial offset). Creates a new Frequency_Landscape_3D document.

03b_4_CREATE_COHERENCE_LAYERS.jsx — ../INTENDING_TOPOLOGY_WORKFLOW/scripts/

Reads pair_coherence_analysis.json (same resolver order: explicit folder override, local folders, Desktop fallback) and the Complete layer, groups vectors by grid coordinate pair key, sorts by coherence score descending, and creates one layer per pair in a new Coherence_Landscape document. Layer opacity = coherenceScore × 80 + frequency × 5, so higher-coherence pairs appear more opaque.

03b_5_CREATE_COHERENCE_STRENGTH_LAYERS.jsx — ../INTENDING_TOPOLOGY_WORKFLOW/scripts/

Reads pair_coherence_analysis.json (same resolver order: explicit folder override, local folders, Desktop fallback), sorts pairs by coherence score, and creates one layer per pair in a new Coherence_Strength_Landscape document with all vector instances for that pair. Layer opacity = 50 + coherenceValue × 80 — highest coherence most opaque, lowest most transparent.

These optional outputs provide opacity/layer-based views of frequency and coherence patterns using the same vector shapes generated in Steps 1-2.


Step 4: Cell selection configuration and composition generation

Reader-scope note: Stage 3c is included here as a dependency checkpoint, not as the canonical operations runbook. For full ingest commands, label-map handling, run-folder numbering, and migration guardrails, use the Stage 3c section in ../INTENDING_TOPOLOGY_WORKFLOW/3x4_COHERENCE_STRATIFIED_WORKFLOW.md.

Stage per-cell coordinate CSVs:

Copies per-cell vectors_coordinates.csv files into the workflow's config/csv_exports/ folder with the standardised cell_<cell_id>_full_vectors_coordinates.csv naming that Step 4 reads. Two modes:

Configure:

Run:

What it does:

How it works:

For each selected cell, loads its coordinate CSV and calls calculate_coherence_from_coords(), which computes: spread_ratio = max_distance / min_distance from centroid, dispersion = std_dev / mean_distance, and coherence = spread_ratio / (1 + dispersion). Pairwise scores are generated via score_pair_compatibility(), with normalized diversity computed as |coh1 − coh2| / max(coh1, coh2) and compatibility as 1 − |coh1 − coh2| / max. Results are categorised into high_coherence_compatible, moderate_mixed, and low_coherence_complementary pairs and written to pair_coherence_composition.json.

How cells_to_analyze.json finds the correct data

It does not auto-discover globally. It points directly to data through csv_directory and strict filename matching.

Data resolution logic in 04_analyze_polygon_region_coherence.py:

  1. CONFIG_FILE = INTENDING_TOPOLOGY_WORKFLOW/config/cells_to_analyze.json
  2. CSV_DIR = Path(config['analysis_config']['csv_directory']) — resolved relative to the config file if not absolute (default: config/csv_exports/)
  3. SELECTED_CELLS = config['analysis_config']['selected_cells']
  4. for each selected cell (for example r1c1), it checks:
  5. CSV_DIR / "cell_r1c1_full_vectors_coordinates.csv"
  6. only found files are analysed; missing cells are reported

It explicitly works from coordinate CSV data created earlier in the process, provided those files exist in the configured directory with the expected naming scheme.


Step 5: Illustrator extraction of coherence/diversity pairs

Run:

Input requirement:

Practical step:

How it works:

Reads pair_coherence_composition.json from the selected workflow run folder and separates entries into high-coherence, moderate, and low-coherence categories. In the active Illustrator document, creates the category layer groups (HIGH_COHERENCE_PAIRS, MODERATE_PAIRS, LOW_COHERENCE_PAIRS) and writes a human-readable polygon_pair_extraction.txt listing pair assignments and values. Region placement/population into those layers remains a manual curation step.

What it produces:


Step 5.5: Pair-network morphology bridge (Blender + ranking)

Bridge extracted pair categories into graph morphology before final spatial sectioning.

Core scripts:

Environment:

Inputs:

Outputs:

Scope note:


Step 6: Spatial translation and comparative section exploration

Translate Stage 5.5 graph morphology into section-based spatial comparisons.

Core sequence:

  1. outer boundary derivation
  2. orthographic section set generation
  3. rotational volumetric read
  4. directed section mobility (development branch)

Primary scripts:

Recent analysis utilities (terminal-side, optional but recommended):

Spec and canonical media reference:


Iterative Refinement Loop

In the current canonical flow, refinement is branch-driven rather than a generic rerun loop:

  1. run Stage 4-5 to classify and extract pair categories (HIGH_COHERENCE_PAIRS, MODERATE_PAIRS, LOW_COHERENCE_PAIRS)
  2. pass selected categories through Stage 5.5 morphology bridge reads
  3. generate Stage 6 section variants (orthographic/rotational/directional)
  4. compare outputs quantitatively (coherence/diversity context plus section surface/overlay metrics)
  5. re-select and regenerate when needed

This keeps iteration aligned with the current 3x4 coherence-stratified branch logic, where refinement is selection-led before regeneration.


Notes on Terminology


Last updated: 19 October 2026