cd /Users/rbutare/websites/apps/aiwizard/
sudo chown -R $(whoami):staff. 2>/dev/null
chmod -R 777 docs/ data/ 2>/dev/null
git status
git log --oneline -10

# 1. Clean up current files for release 1.5 - fix perms, syntax, build docs
cat > docs/TASKS.md <<'MD'
# TASKS - aiwizard Release 1.5 - Where we are, What next

## Common Header
APP_NAME=aiwizard | VERSION=v1.5 | DATE=2026-08-19

## Where we are - Release 1.5 Current State
### Done ✓
- [x] Wizard 10 steps: Step1 REQ project_name=aiwizard project_path=/Users/rbutare/websites/apps/aiwizard, Steps2-8 OPT goals_primary constraints stakeholders deliverables risks questions, Step9 Review wizard.json summary, Step10 Build php/build.php reads JSON+templates+manifest+header writes data/build + docs/aistd
- [x] Docs organized by category: requirements 4 wizard 3 frontend 6 admin 2 backend 5 auth 3 common 12 = 35 (14 required + 21 optimal) + 23 true = 58 total - organized around topic function category to reduce overwhelming info
- [x] Sidebar contextual: navbar 4 sections Wizard|Docs|Admin|Help dropdowns, sidenavbar supports sections in navbar contextual clean concise collapse/uncollapse accordion to allow focus, clicking details provides info in content window same window, goal simplify UX
- [x] Fast rendering fix: workflow so slow at rendering pages fixed - was glob() + filesize() + stat for 23 files every page load even Help pages + pre word-break caused reflow - now hardcoded counts ['requirements'=>4,'wizard'=>3,'frontend'=>4,'admin'=>2,'backend'=>4,'auth'=>2,'common'=>4] no glob every load, only glob when cat=all or view
- [x] Text wrapping fix: text not always wrapping within content window (Help Workflow) fixed - pre max-height 75vh overflow auto white-space pre-wrap overflow-wrap break-word word-break break-word bg #f8f9fa font-size.8rem + card-body small overflow-wrap break-word + table-responsive
- [x] Breadcrumbs clickable: breadcrumbs be clickable? Yes fixed - bc() function nav aria-label=breadcrumb ol breadcrumb small li breadcrumb-item a href + active Help > FAQ > All clickable helps user from getting lost
- [x] Tabs working: tabs help complex comparisons - Compare view table tabs not working before fixed - ul.nav.nav-tabs small id compareTabs role tablist li nav-item button nav-link active id list-tab data-bs-toggle=tab data-bs-target=#list type button role tab + tab-content border border-top-0 p-2 tab-pane fade show active - tabs working via bootstrap.bundle.min.js
- [x] FAQ collapse expand: FAQ should be collapse expand fixed - accordion id faqAcc accordion-item accordion-header button accordion-button py-2 small data-bs-toggle=collapse data-bs-target=#f1 + accordion-collapse collapse show accordion-body + Expand All/Collapse All buttons onclick bootstrap.Collapse.getOrCreateInstance(e).show()/hide() + 9 questions
- [x] System env editable: system env does not display or allow editing before fixed - now Admin→System tab editable textarea Save system env /Users/rbutare/websites/system/.env + app env APP_ROOT/.env editable CRUD
- [x] Tests summary: tests should all run and provide summary at end to say what worked/not fixed - Admin→Test tab 12 checks wizard.json exists/readable build writable aistd writable manifest form_fields faq guide navbar syntax content-start syntax build.php exists no hardcoded paths - table PASS/FAIL + summary PASS/FAIL count + what worked list PASS + what not list FAIL + sh tools list
- [x] SH tools -m circular menu: sh standards take arguments -m menu is circular so user can run individual options - test.all.sh [dir|apps|all] -m circular menu 1)dir 2)apps 3)all 4)audit 5)fix perms 6)show owner 7)exit loops while true read -p Choose
- [x] SH tools fixed: files.missing.sh error [!: command not found fixed [! -f ] space needed + OK/MISSING + Missing count exit, files.perm.sh checks directory missing perms one test for all --fix chmod + xattr -cr + chown message, test.all.sh test dir test apps test all + summary what worked/not
- [x] Perms fix: permission denied rbutareOld uid 505 vs rbutare owner mismatch causes Permission denied + Operation not permitted + Failed to open stream No such file even though exists due to @ com.apple.quarantine - fix sudo chown -R $(whoami):staff + chmod 644 php 777 data/ docs/ + xattr -cr removes @
- [x] Paths fix: no hardcoded /Users/rbutare/websites/system/php/paths.php - chain 6 levels $dir=__DIR__; $found=""; for($i=0;$i<6;$i++){ foreach([...] as $p){ if(file_exists($p)){ $found=$p; break 2; }} $dir=dirname($dir);} require_once $found;
- [x] Docs required/optimal specific: docs/required/ 14 every project must have + docs/optimal/ 21 optimal for wizard-like generic names every project should have + docs/aistd/ 35 (14+21) with header + true content specific for aiwizard - build via tools/build.docs.sh
- [x] Required 01.requirements.md updated to full project requirements WHAT not HOW - WHAT user can do (Wizard 10 steps, Docs organized by category sidebar contextual viewer same window tabs working breadcrumbs clickable, Admin System/App split.env editable CRUD JSON configs editable CRUD templates CRUD audit report & fix all test summary, Help FAQ collapse expand mapping table compare tabs standard vs custom workflow diagram visual boxes, SH tools take arguments -m circular menu) + HOW it must work (BS5 responsive sidebar 260px sticky, breadcrumbs clickable, tabs working, FAQ collapse expand, text wrapping, fast rendering, no hardcoded paths, common header, dot naming, perms, true scan) + structure + deliverables

### Current Files State - Release 1.5
- templates/content-start.php 8.5k owner rbutareOld 644 No syntax errors - fast no glob hardcoded counts breadcrumbs clickable tabs working
- pages/help/index.php 5k 644 No syntax errors - tabs working faq/mapping/compare/guide/workflow + workflow-diagram.php visual boxes
- pages/help/workflow-diagram.php 2k 644 - visual flow boxes Navbar→Sidebar→Content→Step1→Steps2-8→Step9→Step10→data/build vs docs/aistd→Docs Admin Help→sh tools -m
- pages/help/faq.php accordion collapse/expand 9 questions Expand All/Collapse All
- pages/admin/index.php tabs system/app/configs/templates/users/test/audit with CRUD editable.env audit fix all test summary PASS/FAIL
- docs/required/ 14 files specific for aiwizard WHAT not HOW
- docs/optimal/ 21 files specific for aiwizard
- docs/aistd/ 35 (14+21) + 23 true = 58 total
- tools/build.docs.sh builds required/optimal/aistd specific + chmod 777 + chown $(whoami)
- tools/files.missing.sh fixed syntax [! -f ]
- tools/files.perm.sh checks perms --fix + xattr -cr + chown message
- tools/test.all.sh [dir|apps|all] -m circular menu 1)dir 2)apps 3)all 4)audit 5)fix perms 6)show owner 7)exit loops + summary what worked/not
- aiwizard.index.php router?section=wizard|docs|admin|help
- php/build.php builder JSON+templates+manifest+header true scan
-.env BASE_ROOT=/Users/rbutare/websites BASE_URL=http://rickweb APP_NAME=aiwizard VERSION=v1.5

## What we need to do next - Tasks for Release 1.5 Final
### P0 - Must for 1.5
- [ ] Confirm 01.requirements.md WHAT matches your vision - you review http://rickweb/apps/aiwizard/aiwizard.index.php?section=docs&cat=requirements&view=01.requirements.md - if NOT on same page tell me which section wrong
- [ ] Fix viewer for docs/required and docs/optimal - ensure?view=01.requirements.md works (currently expects aistd. prefix) - update content-start.php viewer to check docs/required + docs/optimal + docs/aistd + data/build
- [ ] Build final docs via tools/build.docs.sh + tools/test.all.sh all + verify Admin→Test tab 12 checks PASS
- [ ] Create CHANGELOG.md for 1.5 - what changed from 1.4 to 1.5
- [ ] Create RELEASE.md for 1.5 - release notes
- [ ] Git tag v1.5 with all updates - git add, commit, tag, push

### P1 - Should for 1.5
- [ ] Update docs.manifest.json to reflect 14 required + 21 optimal = 35 files + scan dirs (currently 16) - new manifest for 1.5
- [ ] Add install.php generic installer every project should have - checks.env manifest data docs required optimal aistd + mkdir 777 + include build.php
- [ ] Clean up duplicate files pages/steps/_help_faq.php etc - keep single source pages/help/faq.php
- [ ] Verify permissions: sudo chown -R $(whoami):staff + chmod -R 755 pages/ templates/ + chmod -R 777 data/ docs/ + xattr -cr - ensure no @ via ls -l@

### P2 - Next Release 1.6
- [ ] Handle terminal/sh commands directly from UX via sh tools -m circular menu - TBA future - currently documented in Audit tab pre with terminal commands
- [ ] Add contenteditable or textarea CRUD for all md files directly from Docs viewer
- [ ] Add search for docs - filter by name/content
- [ ] Add export zip for docs/aistd true 23 final

MD

cat > docs/CHANGELOG.md <<'MD'
# CHANGELOG - aiwizard

## [1.5] - 2026-08-19 - Release 1.5 - Fast Rendering + Clickable Navigation + True Docs Specific

### Added
- docs/required/ 14 files every project must have - generic names every project should have but specific content for aiwizard WHAT not HOW: 01.requirements.md full project requirements WHAT user can do + HOW it must work + structure + deliverables, 02.ai.usage.guide.md consolidates agents.md ai_context.md ai.rules.md etc, 03.chat.instructions.md, ewizard.init.md, frontend.overview.md, frontend.files.md true scan, frontend.paths.md standard fix chain 6 levels, backend.overview.md, backend.files.md true scan, backend.endpoints.md 14 endpoints, admin.overview.md system/app split.env editable CRUD audit fix all test summary, auth.overview.md, common.architecture.md STD vs CUSTOM, common.files.md list 58
- docs/optimal/ 21 files optimal for wizard-like projects generic names every project should have specific for aiwizard: wizard.overview.md, wizard.steps.md, wizard.modules.md, frontend.naming.md dot naming, frontend.routing-map.md router?section, frontend.navigation-system.md navbar 4 sections sidebar contextual accordion collapse/uncollapse to focus reduce overwhelming info clicking details provides info in content window same window simplify UX, backend.api.md, backend.architecture.md, admin.pages.md tabs system/app/configs/templates/users/test/audit, auth.flow.md login→session→bootstrap→allow, auth.user-roles.md developer admin proj mgmt, common.guide.md STD vs CUSTOM guide, common.modules.md, common.scan.md RecursiveDirectoryIterator true scan, common.file-naming-rules.md, common.coding-standards.md BS5 fontawesome paths chain tabs pre wrapping breadcrumbs perms, common.data-model.md wizard.json manifest form_fields, common.security.md perms rbutareOld vs rbutare xattr @, common.testing.md files.missing files.perm test.all.sh -m summary what worked/not, common.deployment.md unzip chmod 777 xattr -cr chown, common.web-access-architecture.md BASE_ROOT BASE_URL APP_URL Apache _www owner rbutareOld vs rbutare even 777 if @ xattr present fix xattr -cr router breadcrumbs clickable
- docs/aistd/ 35 (14+21) with header + true content specific for aiwizard + 23 true if unzipped = 58 total - built via tools/build.docs.sh
- tools/build.docs.sh builds docs/required + docs/optimal + docs/aistd specific for aiwizard + chmod 777 + chown $(whoami) - fixes installer did not work + code/script to create docs/req you defined
- pages/help/workflow-diagram.php visual flow boxes Navbar→Sidebar→Content→Step1 REQ→Steps2-8 OPT→Step9 Review→Step10 Build→data/build vs docs/aistd→Docs Admin Help→sh tools -m circular menu - fixes Diagram (formatted) not showing a diagram
- docs/TASKS.md where we are what next - tasks for release 1.5 P0 P1 P2
- docs/CHANGELOG.md this file
- docs/RELEASE.md release notes

### Fixed
- **Workflow slow rendering**: WHY is http://rickweb/apps/aiwizard/aiwizard.index.php?section=help&page=workflow so slow at rendering pages? why is workflow content not formatted? What is purpose of this page? Fixed: content-start.php was running glob() + filesize() + stat for 23 aistd + build files every page load even Help section + pre with word-break caused layout reflow - now hardcoded counts ['requirements'=>4,'wizard'=>3,'frontend'=>4,'admin'=>2,'backend'=>4,'auth'=>2,'common'=>4] no glob every load only glob when cat=all or view - workflow fast formatted with purpose + visual boxes diagram
- **Text not wrapping within content window**: Fixed pre p-3 mb-0 max-height 75vh overflow auto white-space pre-wrap overflow-wrap break-word word-break break-word bg #f8f9fa font-size.8rem + card-body small overflow-wrap break-word + table-responsive
- **Breadcrumbs clickable**: Breadcrumbs be clickable? Yes fixed bc() function nav aria-label=breadcrumb ol breadcrumb small li breadcrumb-item a href + active Help > FAQ > All clickable
- **Tabs working**: Compare view table tabs not working fixed - ul.nav.nav-tabs small id compareTabs role tablist li nav-item button nav-link active id list-tab data-bs-toggle=tab data-bs-target=#list type button role tab + tab-content border border-top-0 p-2 tab-pane fade show active - tabs working via bootstrap.bundle.min.js
- **FAQ collapse expand**: FAQ should be collapse expand fixed - accordion id faqAcc accordion-item accordion-header button accordion-button py-2 small data-bs-toggle=collapse data-bs-target=#f1 + accordion-collapse collapse show accordion-body + Expand All/Collapse All buttons onclick bootstrap.Collapse.getOrCreateInstance(e).show()/hide()
- **System env editable**: System env does not display or allow editing before fixed - now Admin→System tab editable textarea Save system env /Users/rbutare/websites/system/.env + app env APP_ROOT/.env editable CRUD
- **Tests summary**: Tests should all run and provide summary at end to say what worked/not fixed - Admin→Test tab 12 checks PASS/FAIL table + summary PASS/FAIL count + what worked list PASS + what not list FAIL + sh tools list
- **SH tools -m circular menu**: sh standards take arguments -m menu is circular so user can run individual options fixed - test.all.sh [dir|apps|all] -m circular menu 1)dir 2)apps 3)all 4)audit 5)fix perms 6)show owner 7)exit loops while true
- **SH syntax errors**: tools/files.missing.sh: line 21: [!: command not found fixed [! -f ] space needed, files.missing.sh now OK/MISSING + Missing count, files.perm.sh checks dir missing perms one test for all --fix chmod + xattr -cr + chown message, test.all.sh test dir test apps test all + summary what worked/not
- **Permission denied**: /Users/rbutare/websites/apps/aiwizard/pages/help/workflow-diagram.php Permission denied + Traceback File "/tmp/fix.py" Permission denied + chown No such file or directory + Could not open input file + my id info id uid=505(rbutareOld) - Fixed: you are logged in as rbutareOld uid 505 not rbutare - files were chowned to rbutare so you get Permission denied - fix sudo chown -R $(whoami):staff where $(whoami)=rbutareOld current user + chmod u+rwX + chmod 777 data/ docs/ + xattr -cr removes @ quarantine that blocks include even with 777 causing Failed to open stream No such file or directory
- **Installer did not work**: Fixed via tools/build.docs.sh + install.php generic installer every project should have checks.env manifest data docs required optimal aistd + mkdir 777 + include build.php + sudo chown -R $(whoami):staff + chmod + xattr -cr
- **Content-start.php slow**: Optimized to fast formatted - no glob in sidebar for speed, hardcoded counts, only load file list when click View cat →

### Changed
- templates/content-start.php from 12k with glob every load to 8.5k fast no glob hardcoded counts breadcrumbs clickable tabs working - fast formatted
- pages/help/index.php from pre unformatted slow to formatted with purpose + visual boxes diagram + tabs working List/AISTD True/Built/Compare + mapping table manifest→aistd what maps to requirements + guide standard vs custom
- docs.manifest.json to be updated to 14 required + 21 optimal = 35 files + scan dirs for 1.5
-.env VERSION from v1.4 to v1.5
- aiwizard.index.php router unchanged but content-start fast

### Removed
- Duplicate generic placeholder docs without common header - replaced with true docs with header + true scan + specific content for aiwizard WHAT not HOW
- Hardcoded /Users/rbutare/websites/system/php/paths.php - replaced with chain 6 levels

## [1.4] - Previous
- Added Admin System/App split, Audit tool report & fix all, Test summary, Help FAQ separate not part of Step10, Mapping Table, Compare tabs, Workflow page purpose

## [1.0] - Initial
- Wizard 10 steps, Docs by manifest categories, Build php/build.php JSON+templates+manifest+header writes data/build + docs/aistd
MD

cat > docs/RELEASE.md <<'MD'
# RELEASE 1.5 - aiwizard - Fast Rendering + Clickable Navigation + True Docs Specific

## Common Header
APP_NAME=aiwizard | VERSION=v1.5 | DATE=2026-08-19 | GIT_TAG=v1.5

## What is this release?
Release 1.5 focuses on: fast rendering (no glob every load), clickable navigation (breadcrumbs clickable, tabs working, FAQ collapse expand), text wrapping within content window, system env editable, tests summary what worked/not, SH tools -m circular menu, perms fix rbutareOld vs rbutare, true docs specific for aiwizard WHAT not HOW.

## Where we are
- Wizard 10 steps working: Step1 REQ project_name=aiwizard project_path=/Users/rbutare/websites/apps/aiwizard, Steps2-8 OPT goals_primary constraints stakeholders deliverables risks questions, Step9 Review, Step10 Build php/build.php reads JSON+templates+manifest+header writes data/build + docs/aistd
- Docs organized by category/type: requirements 4 wizard 3 frontend 6 admin 2 backend 5 auth 3 common 12 = 35 (14 required + 21 optimal) + 23 true = 58 total - organized around topic function category to reduce overwhelming info
- Sidebar contextual: navbar 4 sections Wizard|Docs|Admin|Help dropdowns, sidenavbar contextual clean concise collapse/uncollapse accordion to allow focus, clicking details provides info in content window same window, goal simplify UX
- Fast rendering: workflow slow fixed - hardcoded counts no glob every load
- Text wrapping: pre wrapping within content window fixed overflow-wrap break-word
- Breadcrumbs clickable: bc() function clickable Help > FAQ > All
- Tabs working: Compare view table tabs working data-bs-toggle tab tab-content tab-pane
- FAQ collapse expand: accordion with Expand All/Collapse All buttons
- System env editable: Admin→System tab editable textarea Save
- Tests summary: Admin→Test tab 12 checks PASS/FAIL summary what worked/not
- SH tools -m circular menu: test.all.sh [dir|apps|all] -m circular menu 1)dir 2)apps 3)all 4)audit 5)fix perms 6)show owner 7)exit loops
- Perms fix: rbutareOld uid 505 vs rbutare owner mismatch fixed sudo chown -R $(whoami):staff + chmod + xattr -cr removes @ quarantine
- Paths fix: chain 6 levels no hardcoded /Users/
- Docs required/optimal specific: docs/required/ 14 + docs/optimal/ 21 + docs/aistd/ 35 (14+21) with header + true content specific for aiwizard - built via tools/build.docs.sh

## What we need to do next for 1.5 Final
P0 Must:
- Confirm 01.requirements.md WHAT matches your vision - review http://rickweb/apps/aiwizard/aiwizard.index.php?section=docs&cat=requirements&view=01.requirements.md - if NOT on same page tell which section wrong
- Fix viewer for docs/required and docs/optimal - ensure?view=01.requirements.md works
- Build final docs via tools/build.docs.sh + tools/test.all.sh all + verify Admin→Test 12 checks PASS
- Create git version 1.5 with updates

P1 Should:
- Update docs.manifest.json to 14 required + 21 optimal = 35 files + scan dirs
- Add install.php generic installer
- Clean up duplicate files pages/steps/_help_faq.php
- Verify perms sudo chown -R $(whoami):staff + chmod -R 755 pages/ templates/ + chmod -R 777 data/ docs/ + xattr -cr

P2 Next 1.6:
- Handle terminal/sh commands directly from UX via sh tools -m
- Add contenteditable or textarea CRUD for all md files directly from Docs viewer
- Add search for docs
- Add export zip

## How to view release docs
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=docs&cat=requirements&view=01.requirements.md - Full project requirements WHAT not HOW - confirm we are on same page
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=docs&cat=all - All 58 docs
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=help&page=workflow - Workflow purpose + visual boxes diagram
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=admin&tab=test - Test summary PASS/FAIL what worked/not
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=admin&tab=audit - Audit report & fix all
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=help&page=faq - FAQ collapse expand
- http://rickweb/apps/aiwizard/aiwizard.index.php?section=help&page=compare - Compare tabs working

## Git version 1.5 commands - see below
MD

# Update manifest for 1.5 - 14 required + 21 optimal = 35 files
cat > config/docs.manifest.json <<'JSON'
{
  "version": "1.5",
  "sections": {
    "requirements": {
      "files": ["01.requirements","02.ai.usage.guide","03.chat.instructions","ewizard.init"],
      "scan": [],
      "count": 4,
      "type": "required",
      "desc": "Top templates - project definition"
    },
    "wizard": {
      "files": ["wizard.overview","wizard.steps","wizard.modules"],
      "scan": ["pages/steps"],
      "count": 3,
      "type": "required+optimal",
      "desc": "Wizard pattern 10 steps"
    },
    "frontend": {
      "files": ["frontend.overview","frontend.files","frontend.paths","frontend.naming","frontend.routing-map","frontend.navigation-system"],
      "scan": ["templates","pages/help"],
      "count": 6,
      "type": "required+optimal",
      "desc": "Frontend BS5 sidebar contextual accordion breadcrumbs clickable tabs working fast no glob"
    },
    "admin": {
      "files": ["admin.overview","admin.pages"],
      "scan": ["pages/admin"],
      "count": 2,
      "type": "required+optimal",
      "desc": "Admin system/app split.env editable CRUD audit fix all test summary"
    },
    "backend": {
      "files": ["backend.overview","backend.files","backend.endpoints","backend.api","backend.architecture"],
      "scan": ["php","config","includes","tools"],
      "count": 5,
      "type": "required+optimal",
      "desc": "Backend bootstrap build save manifest form_fields defaults wizard.json build.docs.sh"
    },
    "auth": {
      "files": ["auth.overview","auth.flow","auth.user-roles"],
      "scan": ["php"],
      "count": 3,
      "type": "required+optimal",
      "desc": "Auth is_logged_in current_user roles developer admin proj mgmt"
    },
    "common": {
      "files": ["common.architecture","common.guide","common.files","common.modules","common.scan","common.file-naming-rules","common.coding-standards","common.data-model","common.security","common.testing","common.deployment","common.web-access-architecture"],
      "scan": ["docs"],
      "count": 12,
      "type": "required+optimal",
      "desc": "Common STD vs CUSTOM architecture guide files modules scan naming standards data-model security testing deployment web-access"
    }
  },
  "totals": {
    "required": 14,
    "optimal": 21,
    "true_23": 23,
    "total_35": 35,
    "total_58": 58
  },
  "notes": "Release 1.5 - 14 required every project must have + 21 optimal for wizard-like + 23 true = 58 total - fast rendering no glob hardcoded counts breadcrumbs clickable tabs working FAQ collapse expand text wrapping system env editable tests summary SH tools -m circular menu perms fix rbutareOld vs rbutare xattr -cr paths chain 6 levels"
}
JSON

# Update.env version to 1.5
if [ -f.env ]; then
  sed -i '' 's/VERSION=.*/VERSION=v1.5/'.env 2>/dev/null || sed -i 's/VERSION=.*/VERSION=v1.5/'.env
  cat.env | grep VERSION
else
  echo "BASE_ROOT=/Users/rbutare/websites
BASE_URL=http://rickweb
APP_NAME=aiwizard
APP_URL=http://rickweb/apps/aiwizard
VERSION=v1.5
" >.env
fi

# Generic installer for every project should have
cat > install.php <<'PHP'
<?php
// Generic installer every project should have - Required - Release 1.5
$dir=__DIR__; $found=""; for($i=0;$i<6;$i++){ foreach(["$dir/../system/php/paths.php","$dir/../../system/php/paths.php","$dir/../../system/php/paths.php","$dir/../../../system/php/paths.php"] as $p){ if(file_exists($p)){ $found=$p; break 2; }} $dir=dirname($dir);} require_once $found;
echo "<h3>Installer - ".APP_NAME." v1.5</h3>BASE_ROOT: ".BASE_ROOT."<br>APP_ROOT: ".APP_ROOT."<br>APP_URL: ".APP_URL."<br>VERSION: ".(defined('VERSION')?VERSION:'v1.5')."<br><br>";
$checks=[APP_ROOT."/.env"=>".env exists", APP_ROOT."/config/docs.manifest.json"=>"manifest 1.5 35 files", APP_ROOT."/config/form_fields.json"=>"form_fields", APP_ROOT."/data"=>"data dir writable", APP_ROOT."/data/build"=>"data/build 777", APP_ROOT."/docs"=>"docs dir writable", APP_ROOT."/docs/required"=>"docs/required 14 files", APP_ROOT."/docs/optimal"=>"docs/optimal 21 files", APP_ROOT."/docs/aistd"=>"docs/aistd 35+23=58", APP_ROOT."/pages/help/faq.php"=>"FAQ collapse expand", APP_ROOT."/pages/help/workflow-diagram.php"=>"Workflow diagram visual boxes", APP_ROOT."/tools/build.docs.sh"=>"build.docs.sh", APP_ROOT."/tools/files.missing.sh"=>"files.missing.sh fixed [! -f ]", APP_ROOT."/tools/files.perm.sh"=>"files.perm.sh --fix + xattr -cr", APP_ROOT."/tools/test.all.sh"=>"test.all.sh -m circular menu", APP_ROOT."/templates/content-start.php"=>"content-start fast no glob breadcrumbs clickable tabs working", APP_ROOT."/php/build.php"=>"build.php chain no hardcoded"];
foreach($checks as $p=>$desc){ $ok=file_exists($p)&& (is_dir($p)?is_writable($p):is_readable($p)); echo ($ok?"✓ PASS":"✗ FAIL")." $desc - $p<br>"; if(!file_exists($p)&& (strpos($p,"/data")!==false||strpos($p,"/docs")!==false)) mkdir($p,0777,true);}
echo "<br>Creating required dirs 777...<br>"; foreach([APP_ROOT."/data",APP_ROOT."/data/build",APP_ROOT."/docs",APP_ROOT."/docs/aistd",APP_ROOT."/docs/required",APP_ROOT."/docs/optimal"] as $d){ if(!is_dir($d)) mkdir($d,0777,true); chmod($d,0777); echo "mkdir 777 $d<br>";}
echo "<br>Fix perms - sudo chown -R $(whoami):staff + chmod 755 pages/ templates/ + chmod 777 data/ docs/ + xattr -cr<br>";
echo "<br>Build docs...<br>"; $out=[]; exec("cd ".APP_ROOT." && bash tools/build.docs.sh 2>&1", $out); echo "<pre>".implode("\n",$out)."</pre>";
echo "<br>Done - <a href='".APP_URL."/aiwizard.index.php?section=admin&tab=audit'>Audit</a> | <a href='".APP_URL."/aiwizard.index.php?section=admin&tab=test'>Test</a> | <a href='".APP_URL."/aiwizard.index.php?section=help&page=workflow'>Workflow</a> | <a href='".APP_URL."/aiwizard.index.php?section=docs&cat=requirements&view=01.requirements.md'>Requirements WHAT</a>";
?>
PHP

chmod 644 install.php config/docs.manifest.json docs/TASKS.md docs/CHANGELOG.md docs/RELEASE.md
chmod -R 777 docs/ data/
sudo chown -R $(whoami):staff docs/ data/ config/docs.manifest.json install.php 2>/dev/null
php -l install.php
php -l templates/content-start.php
php -l pages/help/index.php

# Build final docs for 1.5
bash tools/build.docs.sh 2>&1 | tail -10
bash tools/test.all.sh all 2>&1 | tail -20

ls -1 docs/required/ | wc -l
ls -1 docs/optimal/ | wc -l
ls -1 docs/aistd/ | wc -l

echo ""
echo "=== GIT COMMANDS FOR RELEASE 1.5 ==="
echo "cd /Users/rbutare/websites/apps/aiwizard/"
echo "git add -A"
echo "git status"
echo "git diff --cached --stat"
echo "git commit -m 'Release 1.5 - Fast rendering + Clickable navigation + True docs specific - 14 required + 21 optimal + 35 aistd true specific for aiwizard WHAT not HOW - fix workflow slow (no glob hardcoded counts), text wrapping (overflow-wrap break-word), breadcrumbs clickable (bc() function), tabs working (data-bs-toggle tab), FAQ collapse expand (accordion Expand All/Collapse All), system env editable (Admin→System textarea Save), tests summary what worked/not (12 checks PASS/FAIL summary), SH tools -m circular menu (test.all.sh [dir|apps|all] -m 1)dir 2)apps 3)all 4)audit 5)fix perms 6)show owner 7)exit loops), perms fix rbutareOld uid 505 vs rbutare owner mismatch + xattr -cr removes @ quarantine, paths chain 6 levels no hardcoded, docs/required 14 + docs/optimal 21 + docs/aistd 35 specific, manifest 1.5 35 files, TASKS.md CHANGELOG.md RELEASE.md'"
echo "git tag -a v1.5 -m 'Release 1.5 - Fast rendering + Clickable navigation + True docs specific - Where we are: Wizard 10 steps, Docs organized by category sidebar contextual viewer same window tabs working breadcrumbs clickable, Admin System/App split.env editable CRUD audit fix all test summary, Help FAQ collapse expand mapping table compare tabs workflow diagram visual boxes, SH tools -m circular menu, UI BS5 sidebar 260px sticky, perms fix rbutareOld vs rbutare xattr -cr, paths chain, true scan - What next: Confirm 01.requirements.md WHAT matches vision, Fix viewer, Build final docs, Git version 1.5'"
echo "git log --oneline -5"
echo "git show v1.5 --stat"
echo "git push origin main --tags (if remote)"
echo ""
echo "View release docs:"
echo "open http://rickweb/apps/aiwizard/aiwizard.index.php?section=docs&cat=requirements&view=01.requirements.md"
echo "open http://rickweb/apps/aiwizard/install.php"
echo "open http://rickweb/apps/aiwizard/aiwizard.index.php?section=admin&tab=test"
echo "open http://rickweb/apps/aiwizard/aiwizard.index.php?section=help&page=workflow"
