Obvious onboarding: local dev contract (.obvious/) - #154
Obvious onboarding: local dev contract (.obvious/)#154obvious-autobuild-dev[bot] wants to merge 1 commit into
Conversation
Local dev verified: PHP 8.4 + MariaDB 11.8, all tool pages HTTP 200, browser E2E CSV->JSON conversion passes, telemetry DB writes verified. Sandbox snapshot ob0wxtf01k11upr6a1dv:default captured.
There was a problem hiding this comment.
Obvious Code Review
Verdict: COMMENT (2 Medium findings)
Summary
- Blocker: 0
- High: 0
- Medium: 2
Medium
.obvious/obvious.md:68— ENVIRONMENT detection misdocumented: omits the$_ENV['DOMAIN_NAME']requirement.obvious/codebase-map.md:3— File counts contradict the stated "git-tracked files only" methodology
Claims verified against the repo during review: config.yml repo settings (default branch, merge methods, delete-branch-on-merge), both PHP 8 parse-error locations (s3.php:2582, Profiler.php:70), hardcoded production base_url, default controller, instrument() schema vs the SKILL.md SQL, /csv2json/upload path, and .gitignore coverage of the dev overrides. No secrets in the diff.
| - **Profiler library is PHP 5 only:** `system/libraries/Profiler.php` line 70 has the same parse error; profiler is not enabled in dev. | ||
| - **File upload path is PHP 5 era:** `js/src/csv2json.js` posts to `/csv2json/upload`; the request reaches `csvjson_helper.php` expecting `$_FILES["file"]`, and a bare POST emits a pre-existing PHP 8 warning ("Undefined array key \"file\""). Type/paste CSV instead of uploading files. | ||
| - **Base URL:** production `base_url` is hardcoded to `https://csvjson.com/` in `application/config/config.php`; the development override points it at `http://127.0.0.1:8080/`. | ||
| - **ENVIRONMENT:** `index.php` picks `production` when `SERVER_NAME` contains `csvjson.com`, else `development`. Localhost always gets development (unminified assets from `js/src/`). |
There was a problem hiding this comment.
Medium · hygiene — ENVIRONMENT detection is misdocumented: the doc says index.php picks production "when SERVER_NAME contains csvjson.com", but the actual check (index.php:21-25) is isset($_ENV['DOMAIN_NAME']) && strpos($_SERVER['SERVER_NAME'], $_ENV['DOMAIN_NAME']) !== FALSE — production also requires the DOMAIN_NAME env var to be set. An agent following this contract to simulate or audit production mode (minified bundles, production config, /build) will set SERVER_NAME to a csvjson.com host, silently still get development, and draw wrong conclusions about prod behavior. The same claim appears in codebase-map.md (request flow) and skills/local-dev/SKILL.md (gotchas). Fix: state the actual condition — production only when $_ENV['DOMAIN_NAME'] is set and contained in SERVER_NAME (prod sets DOMAIN_NAME=csvjson.com); otherwise development.
| @@ -0,0 +1,28 @@ | |||
| # Codebase Map — FlatFilers/csvjson-app | |||
|
|
|||
| Depth-capped folder overview. File counts include git-tracked files only. | |||
There was a problem hiding this comment.
Medium · hygiene — File counts contradict the header's "git-tracked files only" methodology. Verified against the git trees API: application/ is 81 in the doc but 78 tracked; application/config/ is 20 vs 17; root is 12 vs 11 — each inflated by untracked sandbox files (the 3 config/development/ overrides and router.php). The rows also never sum to the stated total (scaffolding row says 10, tracked is 11; the 2 files directly in application/ — .htaccess, index.html — appear in no row). Counts that do check out: system/ 149, js/ 93, views/ 27, controllers/ 10, core/ 2, helpers/ 3, libraries/ 5, js/*.min.js 4, css/ 4, img/ 17. Fix: recount from git ls-files, or reword the header to "counts from the onboarding sandbox working tree (includes untracked dev files)".
Obvious Onboarding — Local Dev Contract
This PR adds the
.obvious/agent guidance contract for this repository, generated after a full local-dev onboarding run in the repo sandbox.Files generated
.obvious/obvious.md.obvious/codebase-map.md.obvious/config.ymlmaster, merge methodmerge,deleteBranchOnMerge: false).obvious/skills/local-dev/SKILL.mdSource files scanned
README.md(installation, extending, deploy, FAQ),ISSUE_TEMPLATE.md,.gitignore,.htaccess,.user.iniindex.php,application/config/—config.php,database.php,routes.php,autoload.php,assets.php,aws_s3.php,profiler.php,migration.php,production/database.phpapplication/core/MY_Controller.php, all 9 controllers,application/helpers/csvjson_helper.php,application/libraries/application/views/(layout + tool views),js/src/+js/csvjson/(conversion libraries),js/3rd/,css/,img/system/(CodeIgniter 2.1.4 — scanned for PHP 8 compatibility, unmodified)Local dev validation result
dev_stack_healthy: true — verified on PHP 8.4.24 / MariaDB 11.8.6 / Debian 13:
/csv2json,/json2csv,/sql2json,/json_validator,/json_beautifier,/csvjson2json,/datajanitor) return HTTP 200 with zero PHP error output and a clean<!DOCTYPE html>startapplication/config/assets.phpexist and serve HTTP 200/csv2json, typed CSV into#csv, clicked#convert,#resultcontained the correct JSON — zero browser console errors (screenshot captured)POST /csv2json/instrumentwrites rows to MariaDBcsvjson.csv(verified by SELECT)php -lover all 63application/+ 127system/PHP files/system/...,/.git/...,/README.mdreturn 403 via the dev routerSandbox snapshot
ob0wxtf01k11upr6a1dv:default(sandboxi01p5umk7ly564q1bj9mc)csvjsondatabase seeded, dev config overrides androuter.phpin placeBlockers
None. The dev stack gate passed.
Explicit omissions
php -lsyntax checks are the only static verification available; no unit tests were run because there are none.router.phpis intentionally NOT committed — it is an untracked dev-server router for the PHP built-in server (documented inSKILL.md, included in the sandbox snapshot). Production uses Apache +.htaccess.application/config/development/overrides are intentionally NOT committed — the directory is gitignored by the repo itself; contents are documented inSKILL.mdfor fresh-clone recreation.application/libraries/s3.phpcontains a pre-existing PHP 8 parse error (PHP 5-era curly-brace string offset) and local dev uses disk-based permalink storage instead. No AWS secrets were requested or needed./csv2json/uploadis a PHP 5-era path expecting$_FILES['file']; the primary textarea-based conversion flow was verified instead.