List each AI enhancement against the script it enhances

Declared in PHP rather than in each bash header, against scriptinfo's usual rule
that the header next to the code is authoritative: it is authoritative about what
the script does, and an enhancement is something else reading its output, gated
by a flag the script has never heard of. A description of PHP inside a file that
cannot enforce it would drift the first time either changed.

Shown with its switch, so "there is an enhancement" and "it is running" are never
the same claim. Discovery is listed even though nothing acts on its output — it
takes the first accessible root folder with no regard for content, and the
classification scan is what notices that night. That relationship explains where
misfiled series come from and was written down nowhere.
This commit is contained in:
Gmer4Lfe
2026-08-14 22:25:24 -04:00
parent 60971f1af4
commit a705aa36b7
3 changed files with 96 additions and 4 deletions
+15 -4
View File
@@ -113,9 +113,20 @@ foreach ($searchFiles as [$label, $file]) {
if ($body) $sections[] = ['source' => $label, 'body' => $body];
}
// Any AI enhancement that reads this script's output, and whether it is switched on. Kept out of
// $sections because it is not documentation: the sections above describe what the script does, and
// this describes something else that watches it. Merging them would put a claim in the doc panel
// that the script's own header cannot support.
//
// require_once here rather than at the top: ai_repair.php pulls in the findings layer, and a
// scheduler info request on a host with AI off has no reason to load it.
require_once dirname(__DIR__) . '/include/ai_repair.php';
$enhancement = function_exists('vv_ai_script_enhancements') ? vv_ai_script_enhancements($id) : [];
echo json_encode([
'ok' => true,
'name' => $name,
'header' => $header,
'sections' => $sections,
'ok' => true,
'name' => $name,
'header' => $header,
'sections' => $sections,
'enhancement' => $enhancement ?: null,
]);