Skip to content

Commit 75b47c4

Browse files
committed
protocol update
1 parent c09d387 commit 75b47c4

2 files changed

Lines changed: 179 additions & 15 deletions

File tree

assets/protocol_assets/system/graph_population/v001/graph_population_control_protocol.md

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,14 @@ ask for that approval and continue after approval. Do not convert absent tool
26262626
approval into a graph-population blocker. If approval is denied, stop with a
26272627
source-approval failure that names the denied capability.
26282628

2629+
For ordinary `MAKE-GRAPH`, source-backed means backed by admissible persisted
2630+
source evidence, not by a single privileged adapter. A generated bundle must
2631+
not treat one public source family outage, throttle, timeout, malformed
2632+
response, or shallow result as global source exhaustion while admissible source
2633+
adapter candidates remain. Unless the human explicitly restricted sources,
2634+
source adapter expansion is a normal Markdown recovery loop and does not
2635+
require human approval merely because the next adapter is different.
2636+
26292637
If the manifest explicitly says `no_live_lookup`, `bundle_only`,
26302638
`scaffold_only`, `smoke_only`, or `no_population`, and no source batches are
26312639
provided, source-backed population cannot proceed and the executor must stop
@@ -2645,6 +2653,10 @@ Before source lookup, identify:
26452653
- disallowed sources;
26462654
- source adapter ID;
26472655
- fallback source adapter order;
2656+
- source adapter expansion policy;
2657+
- source adapter registry path;
2658+
- source adapter candidate frontier path;
2659+
- same-source-family exhaustion rule;
26482660
- timeout, retry, and backoff policy;
26492661
- batch size and batch runtime budget;
26502662
- repo-local source batch cache path;
@@ -2656,10 +2668,15 @@ Before source lookup, identify:
26562668
If any source boundary is missing, do not crawl. Stop with
26572669
`missing_source_boundary`.
26582670

2659-
If any source adapter, timeout, retry, fallback, or batch policy required by
2660-
the loop is missing, do not crawl. Stop with
2671+
If any source adapter, timeout, retry, fallback, adapter-expansion, or batch
2672+
policy required by the loop is missing, do not crawl. Stop with
26612673
`missing_source_execution_policy`.
26622674

2675+
If an ordinary `MAKE-GRAPH` loop's fallback order contains only variants of one
2676+
source family and lacks a source-adapter expansion policy/frontier, stop with
2677+
`incomplete_source_adapter_expansion_policy` before treating that source family
2678+
as exhaustive.
2679+
26632680
If the loop has no repo-local source batch cache path, do not crawl. Stop with
26642681
`missing_source_cache_path`.
26652682

@@ -2694,9 +2711,10 @@ When trouble occurs:
26942711

26952712
```text
26962713
timeout -> retry_if_budget_remains -> fallback_if_declared -> recovery_child_loop_if_declared -> recovery_exhausted_stop
2697-
rate_limited -> backoff_if_declared -> fallback_if_declared -> recovery_child_loop_if_declared -> recovery_exhausted_stop
2698-
malformed_response -> retry_if_budget_remains -> fallback_if_declared -> recovery_child_loop_if_declared -> recovery_exhausted_stop
2699-
insufficient_results -> persist_partial_success -> update_frontier -> source_strategy_recovery_child_loop_if_budget_remains -> recovery_exhausted_stop
2714+
rate_limited -> backoff_if_declared -> fallback_if_declared -> source_adapter_expansion_child_loop_if_same_family_exhausted -> recovery_exhausted_stop
2715+
malformed_response -> retry_if_budget_remains -> fallback_if_declared -> source_adapter_expansion_child_loop_if_same_family_exhausted -> recovery_exhausted_stop
2716+
source_adapter_unavailable -> checkpoint -> source_adapter_expansion_child_loop_if_candidates_remain -> recovery_exhausted_stop
2717+
insufficient_results -> persist_partial_success -> update_frontier -> source_strategy_or_adapter_expansion_child_loop_if_budget_remains -> recovery_exhausted_stop
27002718
insufficient_depth_for_declared_fields -> persist_partial_success -> field_recovery_child_loop_if_budget_remains -> field_recovery_exhausted_stop
27012719
insufficient_relation_family_diversity -> relation_recovery_child_loop_if_budget_remains -> relation_discovery_recovery_exhausted_stop
27022720
insufficient_pair_evidence_for_edges -> edge_evidence_recovery_child_loop_if_budget_remains -> edge_evidence_recovery_exhausted_stop
@@ -2715,17 +2733,26 @@ pair-specific evidence are satisfied.
27152733

27162734
If source lookup cannot yet support declared type fields, declared relation
27172735
fields, source-backed instances, or pair-specific edge evidence, the executor
2718-
must run the declared recovery ladder before stopping. Only after recovery is
2719-
exhausted may it stop with the precise limitation. Do not fill target counts
2720-
with deterministic local completion, placeholder values, source-adapter-only
2721-
identity rows, endpoint pairings, or scaffold records unless the human
2722-
explicitly requested scaffold or smoke mode.
2736+
must run the declared recovery ladder before stopping. For ordinary
2737+
`MAKE-GRAPH`, that ladder includes source-adapter expansion unless the human
2738+
explicitly restricted sources or the adapter frontier is exhausted. Only after
2739+
recovery is exhausted may it stop with the precise limitation. Do not fill
2740+
target counts with deterministic local completion, placeholder values,
2741+
source-adapter-only identity rows, endpoint pairings, or scaffold records unless
2742+
the human explicitly requested scaffold or smoke mode.
27232743

27242744
Failure and event codes:
27252745

27262746
```text
27272747
source_batch_timeout
27282748
source_rate_limited
2749+
source_adapter_unavailable
2750+
source_adapter_expansion_required
2751+
source_adapter_expansion_started
2752+
source_adapter_candidate_accepted
2753+
source_adapter_candidate_rejected
2754+
source_adapter_expansion_exhausted
2755+
source_scope_user_restricted
27292756
source_malformed_response
27302757
source_fallback_used
27312758
source_partial_success
@@ -2734,8 +2761,42 @@ source_depth_limited
27342761
field_richness_limited
27352762
edge_evidence_limited
27362763
missing_source_execution_policy
2764+
incomplete_source_adapter_expansion_policy
2765+
```
2766+
2767+
### 15.2 Source Adapter Expansion Recovery
2768+
2769+
For ordinary `MAKE-GRAPH`, a source adapter is a recoverable execution choice,
2770+
not the definition of the domain. If one adapter family fails, the executor
2771+
must ask whether admissible adapter candidates remain before marking the run
2772+
blocked.
2773+
2774+
The next legal action after same-family source failure is:
2775+
2776+
```text
2777+
1. checkpoint the failing batch;
2778+
2. persist any partial source cache and Markdown report;
2779+
3. update cursor.active_recovery with source_adapter_expansion_required;
2780+
4. create or update runs/<run_id>/source_adapter_candidate_frontier.md;
2781+
5. create or update a Markdown batch packet for adapter evaluation;
2782+
6. evaluate the next admissible adapter candidate;
2783+
7. persist its probe result under runs/<run_id>/source_batches/;
2784+
8. resume the parent source loop if the adapter satisfies the evidence shape.
27372785
```
27382786

2787+
A new adapter candidate may be accepted without Project Owner approval when it
2788+
is public, legal to access under ordinary live lookup, inside the user-provided
2789+
or generated source scope, and can be persisted/reported through the run
2790+
artifact tree. Human approval is required only for credentialed, paid,
2791+
private/personal, terms-of-service-sensitive, or explicitly out-of-scope
2792+
sources.
2793+
2794+
The executor may stop with `source_strategy_recovery_exhausted` or
2795+
`source_depth_limited` only when the adapter frontier has been exhausted,
2796+
source scope was explicitly restricted by the human, or every remaining adapter
2797+
candidate requires approval that has been denied or cannot be requested in the
2798+
current run.
2799+
27392800
### 15.2 Markdown Batch Execution Discipline
27402801

27412802
Any loop that crawls sources or may process many graph records must execute in

assets/protocol_assets/system/graph_population/v001/graph_population_protocol_schema.md

Lines changed: 108 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,8 @@ Recoverable semantic failures include:
12031203
```text
12041204
insufficient_results
12051205
source_rate_limited
1206+
source_adapter_unavailable
1207+
source_adapter_expansion_required
12061208
source_depth_limited
12071209
field_richness_limited
12081210
relation_family_diversity_unmet
@@ -1225,6 +1227,8 @@ narrow_query
12251227
broaden_query
12261228
switch_source_adapter
12271229
switch_source_class
1230+
discover_new_source_adapter
1231+
evaluate_source_adapter_candidate
12281232
seed_from_authoritative_index
12291233
extract_seed_list
12301234
split_current_type_or_edge_work_into_batches
@@ -1240,9 +1244,15 @@ directory. Recovery may not be hidden in Python, shell scripts, notebooks,
12401244
model memory, terminal history, or temporary files.
12411245

12421246
A recovery ladder is exhausted only when the generated attempt budget, source
1243-
fallback order, query rewrite policy, source-class expansion policy, and
1244-
frontier expansion policy have all been tried or explicitly ruled out. Only
1245-
then may the run stop with a recovery-exhausted limitation such as:
1247+
fallback order, query rewrite policy, source-adapter expansion policy,
1248+
source-class expansion policy, and frontier expansion policy have all been
1249+
tried or explicitly ruled out. For ordinary `MAKE-GRAPH`, an outage, timeout,
1250+
malformed response, rate limit, sparse result, or depth limit in one source
1251+
adapter or one source family does not exhaust recovery. It must route to the
1252+
explicit Markdown source-adapter expansion child loop unless the human
1253+
explicitly restricted the source scope or all admissible source-adapter
1254+
candidates have already been evaluated and rejected in repo-local reports.
1255+
Only then may the run stop with a recovery-exhausted limitation such as:
12461256

12471257
```text
12481258
source_strategy_recovery_exhausted
@@ -1914,7 +1924,12 @@ Minimum candidate shape:
19141924
"live_population_lookup_authorization": "authorized_by_make_graph",
19151925
"population_without_live_or_supplied_sources": "not_applicable_live_lookup_authorized",
19161926
"explicit_no_live_lookup_overrides_make_graph_default": false,
1917-
"source_fallback_order": []
1927+
"source_fallback_order": [],
1928+
"source_adapter_registry_path": "runs/run_001/source_adapter_registry.md",
1929+
"source_adapter_candidate_frontier_path": "runs/run_001/source_adapter_candidate_frontier.md",
1930+
"source_adapter_expansion_allowed_by_default": true,
1931+
"source_adapter_expansion_requires_human_approval": false,
1932+
"same_source_family_exhaustion_rule": "do_not_treat_one_source_family_failure_as_global_source_exhaustion"
19181933
},
19191934
"field_policy": {
19201935
"field_tier_contract_defined": true,
@@ -2341,6 +2356,83 @@ stop_with_source_failure
23412356

23422357
The executor must not invent this policy during the run.
23432358

2359+
### 7.1.1 Domain-Discovered Source Adapter Expansion Contract
2360+
2361+
For ordinary `MAKE-GRAPH`, source-backed means backed by admissible persisted
2362+
source evidence. It does not mean backed by one privileged source adapter.
2363+
Wikidata, a public API, a search result page, an official organization page, an
2364+
authority file, a catalog, a repository, or another public source family can be
2365+
an adapter if the generated protocol records how it is queried, filtered,
2366+
persisted, and interpreted through Markdown reports.
2367+
2368+
Unless the human explicitly restricts sources, source adapter expansion is an
2369+
internal generated recovery loop. It does not require human approval merely
2370+
because the next adapter is different from the first adapter. Human approval is
2371+
required only when the candidate adapter needs credentials, payment, private or
2372+
personal data access, terms-of-service-sensitive scraping, a non-public source,
2373+
or a source family outside an explicit user-provided source scope.
2374+
2375+
Every ordinary `MAKE-GRAPH` bundle must define a source adapter registry and an
2376+
adapter expansion frontier:
2377+
2378+
```text
2379+
source_adapter_registry_path:
2380+
source_adapter_candidate_frontier_path:
2381+
source_adapter_expansion_policy:
2382+
source_adapter_expansion_allowed_by_default: true
2383+
source_adapter_expansion_requires_human_approval: false unless credentialed/private/restricted
2384+
source_scope_restriction_rule:
2385+
adapter_candidate_evaluation_criteria:
2386+
same_source_family_exhaustion_rule:
2387+
```
2388+
2389+
A source fallback order that contains only variants of one source family, such
2390+
as two endpoints for the same public database, is not a complete recovery
2391+
policy for ordinary `MAKE-GRAPH`. It is only the first adapter-family retry
2392+
plan. If that source family rate-limits, times out, malforms responses, or is
2393+
too shallow, the next legal recovery action is to create or advance a Markdown
2394+
source-adapter expansion child loop.
2395+
2396+
The generated source-adapter expansion loop must be domain-agnostic in shape
2397+
and domain-specific only in its discovered candidates. It may consider source
2398+
families such as:
2399+
2400+
```text
2401+
official domain or institution pages
2402+
public APIs
2403+
public catalogs or collection databases
2404+
authority files or controlled vocabularies
2405+
public indexes or registries
2406+
entity pages from the current source family
2407+
source pages cited by already accepted records
2408+
search/discovery results that lead to persisted source batches
2409+
human-supplied source files or URLs
2410+
```
2411+
2412+
Before a new adapter can affect graph JSON, the generated Markdown child loop
2413+
must record:
2414+
2415+
```text
2416+
adapter_candidate_id:
2417+
source_family:
2418+
why_relevant_to_current_domain:
2419+
allowed_query_or_navigation_shapes:
2420+
evidence_shape:
2421+
expected_record_types:
2422+
coverage_probe_plan:
2423+
rate_limit_or_timeout_policy:
2424+
persistence_plan_under_runs/<run_id>/source_batches:
2425+
markdown_report_path:
2426+
accept_reject_defer_decision:
2427+
reason:
2428+
```
2429+
2430+
If one adapter fails but admissible adapter candidates remain unevaluated, the
2431+
run must not stop with `source_depth_limited`, `source_rate_limited`, or
2432+
`source_strategy_recovery_exhausted`. It must stop only the current batch,
2433+
checkpoint state, create/update the source-adapter expansion child loop, and
2434+
continue there when execution budget permits.
2435+
23442436
## 7.2 Markdown Batch Partition Contract
23452437

23462438
Every crawl loop that can touch an external source or a large graph surface
@@ -3975,6 +4067,11 @@ child_loop_generation_rule:
39754067
recovery_attempt_budget:
39764068
source_strategy_fallback_order:
39774069
query_rewrite_policy:
4070+
source_adapter_expansion_policy:
4071+
source_adapter_registry_path:
4072+
source_adapter_candidate_frontier_path:
4073+
source_adapter_candidate_evaluation_criteria:
4074+
same_source_family_exhaustion_rule:
39784075
source_class_expansion_policy:
39794076
frontier_expansion_policy:
39804077
resume_parent_condition:
@@ -4000,6 +4097,9 @@ max_sources_checked:
40004097
evidence_threshold:
40014098
source_adapter_id:
40024099
source_fallback_order:
4100+
source_adapter_expansion_policy:
4101+
source_adapter_registry_path:
4102+
source_adapter_candidate_frontier_path:
40034103
timeout_seconds:
40044104
max_retries:
40054105
backoff_seconds:
@@ -4132,6 +4232,7 @@ pair_evidence_review_rule: edge instances need exact source-relation-target evid
41324232
counter_reconciliation_rule: accepted counters must match graph_build_target using accepted primitive families
41334233
status_rule: only exact semantic_acceptance_status: passed completes the run
41344234
generated_script_rejection_rule: generated population scripts are forbidden workflow drivers
4235+
source_adapter_expansion_rule: one adapter-family failure routes to Markdown adapter expansion, not global source failure
41354236
recovery_rule: if recoverable gaps remain, create/update Markdown child loops and continue
41364237
```
41374238

@@ -4234,6 +4335,7 @@ Compatibility requires:
42344335
- path reconciliation fields;
42354336
- source crawl boundaries;
42364337
- source adapter fallback policy;
4338+
- source adapter expansion policy and adapter candidate frontier for ordinary `MAKE-GRAPH`;
42374339
- recoverable semantic failure policy;
42384340
- child-loop generation policy for source, field, relation, instance, and edge-evidence recovery;
42394341
- batch execution policy;
@@ -4483,7 +4585,8 @@ A generated protocol bundle is acceptable only if:
44834585
- every semantic loop spec defines a recovery ladder, child-loop generation rule, recovery budget, resume condition, exhaustion condition, and proxy-substitution ban;
44844586
- every loop spec defines source boundaries;
44854587
- every source-crawling loop defines source adapters, fallback behavior,
4486-
timeout/retry behavior, semantic recovery behavior, and batch execution;
4588+
source-adapter expansion behavior, timeout/retry behavior, semantic recovery
4589+
behavior, and batch execution;
44874590
- every batch-capable loop defines
44884591
`batch_execution_meaning: markdown_batch_partition_not_generated_code_loop`;
44894592
- every batch-capable loop defines `batch_plan_path` and

0 commit comments

Comments
 (0)