|
1 | 1 | ### **Commit / Ticket Reference** |
2 | 2 |
|
| 3 | +* **Commit:** `test(API) wrote controller test after making changes for pooler connection (#49)` |
| 4 | +* **Ticket:** `#49 — Implement Demoable Client + Pooler Stability` |
| 5 | +* **Date:** November 13, 2025 |
| 6 | +* **Team Member:** Jalen Stephens |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +### **AI Tool Information** |
| 11 | + |
| 12 | +* **Tool Used:** OpenAI ChatGPT (GPT-5) via Codex CLI |
| 13 | +* **Access Method:** Local Codex CLI session (sandboxed, no paid API usage) |
| 14 | +* **Configuration:** Default model parameters supplied by course tooling |
| 15 | +* **Cost:** $0 (educational access) |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +### **Purpose of AI Assistance** |
| 20 | + |
| 21 | +Used AI to draft and refine the new controller-focused regression tests that restore JaCoCo coverage after the pooler/database changes. Guidance covered: |
| 22 | + |
| 23 | +* Designing slice tests for `AnalyzeController` (submit, status, manifest, compare) |
| 24 | +* Adding `HealthControllerTest` to drive both branches of the DB health ping and metadata endpoint |
| 25 | +* Restructuring `SecurityConfigMvcTest` to avoid datasource/autowire failures while still verifying CORS + JWT rules |
| 26 | +* Capturing the environment tweaks (`application.properties`, Mockito plugin) needed to boot the test slices without pooler credentials |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +### **Prompts / Interaction Summary** |
| 31 | + |
| 32 | +* “write AnalyzeController MockMvc tests that assert JSON payloads and verify service calls” |
| 33 | +* “add HealthController tests without talking to a real DB” |
| 34 | +* “security config test fails because of datasource—convert to WebMvcTest and stub controllers” |
| 35 | +* “how do I stop Mockito inline from requiring the byte-buddy agent in the sandbox?” |
| 36 | +* “fill out the commit citation entry using the standard template” |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +### **Resulting Artifacts** |
| 41 | + |
| 42 | +* Added controller tests: |
| 43 | + * `src/test/java/dev/coms4156/project/metadetect/controller/AnalyzeControllerTest.java` |
| 44 | + * `src/test/java/dev/coms4156/project/metadetect/controller/HealthControllerTest.java` |
| 45 | +* Hardened security slice testing: |
| 46 | + * `src/test/java/dev/coms4156/project/metadetect/config/SecurityConfigMvcTest.java` |
| 47 | + * `src/test/java/dev/coms4156/project/metadetect/config/SecurityTestControllers.java` |
| 48 | +* Test-only infrastructure: |
| 49 | + * `src/test/resources/application.properties` (stable Supabase defaults for tests) |
| 50 | + * `src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker` |
| 51 | + * `pom.xml` dependency cleanup (removed `mockito-inline`) |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +### **Verification** |
| 56 | + |
| 57 | +* Targeted suite: |
| 58 | + `MAVEN_USER_HOME=$PWD/.m2 ./mvnw -q -Dtest=AuthControllerTest,ImageControllerTest,AnalyzeControllerTest,HealthControllerTest,SecurityConfigMvcTest test` |
| 59 | +* All targeted tests pass. Full `./mvnw test` still blocked in `SupabaseStorageServiceTest` / `AuthProxyServiceTest` because the course sandbox forbids binding local sockets for `MockWebServer`; rerun outside the sandbox to regenerate JaCoCo. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +### **Attribution Statement** |
| 64 | + |
| 65 | +> Portions of this commit were generated with assistance from OpenAI ChatGPT (GPT-5) on November 13, 2025. All AI-generated content was reviewed, tested, and validated by the development team before committing. |
| 66 | +
|
| 67 | +--- |
| 68 | + |
| 69 | +### **Commit / Ticket Reference** |
| 70 | + |
3 | 71 | * **Commit:** `chore(init): renamed project to MetaDetect, updated package structure, pom.xml coordinates, and Spring Boot configuration (#2)` |
4 | 72 | * **Ticket:** [#2 — INIT Project Skeleton Code](https://github.com/Jalen-Stephens/AdvanceJavaStudentEngineers/issues/2) |
5 | 73 | * **Date:** October 15 2025 |
@@ -43,6 +111,70 @@ Prompts and questions provided to ChatGPT included: |
43 | 111 |
|
44 | 112 | ### **Resulting Artifacts** |
45 | 113 |
|
| 114 | +--- |
| 115 | + |
| 116 | +### **Commit / Ticket Reference** |
| 117 | + |
| 118 | +* **Commit:** `bug(DB): fixes to help pooler connection limit (#49)` |
| 119 | +* **Ticket:** `#49 — Implement Demoable Client + Pooler Stability` |
| 120 | +* **Date:** October 25, 2025 |
| 121 | +* **Team Member:** Jalen Stephens |
| 122 | + |
| 123 | +--- |
| 124 | + |
| 125 | +### **AI Tool Information** |
| 126 | + |
| 127 | +* **Tool Used:** OpenAI ChatGPT (GPT-5) |
| 128 | +* **Access Method:** ChatGPT Web (.edu academic access) |
| 129 | +* **Configuration:** Default model settings |
| 130 | +* **Cost:** $0 (no paid API calls) |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +### **Purpose of AI Assistance** |
| 135 | + |
| 136 | +The AI assistant helped diagnose Supabase pooler exhaustion by reviewing how Spring transactions were scoped around long-running storage calls. Guidance focused on: |
| 137 | + |
| 138 | +* Shortening transaction lifetimes in `ImageService` so uploads/deletes don’t hold DB connections while streaming to Supabase Storage. |
| 139 | +* Adding orphan-cleanup logic so failed uploads best-effort delete the metadata row, preventing dangling rows that require manual cleanup. |
| 140 | +* Removing the broad `@Transactional` annotation from `AnalyzeService.submitAnalysis` so the expensive C2PA invocation runs outside the JDBC session. |
| 141 | +* Clarifying how to source `env.pooler.sh` so the smaller pool-size and timeout overrides are consistently applied during local runs. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +### **Prompts / Interaction Summary** |
| 146 | + |
| 147 | +* “Connections aren’t closing against the pooler—can you check `ImageService` for long transactions?” |
| 148 | +* “How can we make sure upload failures roll back the metadata row even after the storage call throws?” |
| 149 | +* “Should AnalyzeService keep the transaction open while running the C2PA CLI?” |
| 150 | +* “Remind me how to use `env.pooler.sh` so Hikari sees the 2-connection limit.” |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +### **Resulting Artifacts** |
| 155 | + |
| 156 | +* `src/main/java/dev/coms4156/project/metadetect/service/ImageService.java` |
| 157 | + * Removed class-level `@Transactional` usage from controller entry points; now only the RLS helpers manage transactions. |
| 158 | + * Introduced `deleteOrphanedImage()` with logging to clean up rows when uploads fail midstream. |
| 159 | + * Wrapped upload flow in try/catch so DB rows are rolled back before rethrowing storage errors. |
| 160 | +* `src/main/java/dev/coms4156/project/metadetect/service/AnalyzeService.java` |
| 161 | + * `submitAnalysis` now persists the PENDING row and immediately releases the connection before downloading assets or running C2PA. |
| 162 | +* `env.pooler.sh` |
| 163 | + * Documented values reiterated so the pooler JDBC URL, credentials, and keepalive hints are sourced for local testing. |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +### **Verification** |
| 168 | + |
| 169 | +* Ran `mvn -DskipTests compile` — build succeeded (only existing Guice `sun.misc.Unsafe` warnings remain). |
| 170 | +* Manual inspection confirmed all repository calls now occur within short-lived RLS-wrapped scopes, preventing Hikari from exceeding the 2-connection pooler cap. |
| 171 | + |
| 172 | +--- |
| 173 | + |
| 174 | +### **Attribution Statement** |
| 175 | + |
| 176 | +> Portions of the connection-scope refactor and pooler troubleshooting guidance for this commit were generated with assistance from **OpenAI ChatGPT (GPT-5)** on October 25, 2025. The development team reviewed, tested, and validated all AI-assisted changes prior to committing. |
| 177 | +
|
46 | 178 | * Updated project structure → `dev/coms4156/project/metadetect` |
47 | 179 | * Updated `MetaDetectApplication.java` and `application.properties` |
48 | 180 | * Rewritten `pom.xml` with MetaDetect metadata, PMD, Checkstyle, and JaCoCo rules |
@@ -346,6 +478,77 @@ The AI assisted in designing the revised database schema to align authentication |
346 | 478 |
|
347 | 479 | ### **Commit / Ticket Reference** |
348 | 480 |
|
| 481 | +* **Commit:** `feat(Init): Demo UI Setup Initi (#49)` |
| 482 | +* **Ticket:** [#49 — Implement demoable client in same repository](https://github.com/Jalen-Stephens/AdvanceJavaStudentEngineers/issues/49) |
| 483 | +* **Date:** November 10, 2025 |
| 484 | +* **Team Member:** Jalen Stephens |
| 485 | + |
| 486 | +--- |
| 487 | + |
| 488 | +### **AI Tool Information** |
| 489 | + |
| 490 | +* **Tool Used:** OpenAI ChatGPT (GPT-5) |
| 491 | +* **Access Method:** Codex CLI (local workstation) connected to ChatGPT via academic access |
| 492 | +* **Configuration:** Default reasoning profile; no fine-tuning or paid API usage |
| 493 | +* **Cost:** $0 (covered by institutional access) |
| 494 | + |
| 495 | +--- |
| 496 | + |
| 497 | +### **Purpose of AI Assistance** |
| 498 | + |
| 499 | +The assistant helped design and implement the in-repo demo client (“Pulse”) that exercises the MetaDetect auth and media APIs. This included: |
| 500 | + |
| 501 | +* Planning the folder layout under `client/` and deciding on a framework-free static build (HTML/CSS/JS). |
| 502 | +* Creating the login/sign-up experience that proxies `/auth/signup` and `/auth/login`, persists Supabase access tokens, and redirects to the media composer. |
| 503 | +* Building “Pulse Studio,” a social-style posting page that uploads images, annotates captions and hashtags, lists prior uploads, previews signed URLs, and deletes posts. |
| 504 | +* Styling both pages to resemble a polished social app experience while remaining framework-agnostic for easy demoing. |
| 505 | +* Updating `README.md` with hosting instructions, routing behavior, and token-handling notes, plus tightening `.gitignore` for future client tooling. |
| 506 | + |
| 507 | +--- |
| 508 | + |
| 509 | +### **Prompts / Interaction Summary** |
| 510 | + |
| 511 | +Representative instructions provided to the AI: |
| 512 | + |
| 513 | +* “Create a social-media inspired login/sign-up UI that hits our `/auth` APIs and show responses inline.” |
| 514 | +* “Build another page where creators can upload images, add captions/hashtags, and delete posts using `/api/images`.” |
| 515 | +* “Automatically store the Supabase access token in the browser and reuse it so users don’t have to paste it.” |
| 516 | +* “Hide the bearer token in the UI but still let me override it if needed.” |
| 517 | +* “Update the README with steps for serving the client and describe Pulse Studio.” |
| 518 | +* “Add a CTA on the login page that jumps to the composer, and auto-redirect to the composer after logging in.” |
| 519 | + |
| 520 | +--- |
| 521 | + |
| 522 | +### **Resulting Artifacts** |
| 523 | + |
| 524 | +* `client/index.html`, `client/styles.css`, `client/app.js` — Pulse login/sign-up client with Supabase token persistence and auto-redirect. |
| 525 | +* `client/compose.html`, `client/compose.css`, `client/compose.js` — Pulse Studio composer supporting uploads, captions/labels, feed rendering, signed URL previews, and inline deletes. |
| 526 | +* `client/config.js` — central base-URL configuration for targeting different backend instances. |
| 527 | +* `.gitignore` — ignores future client build outputs (`client/node_modules`, `client/dist`, `.cache`). |
| 528 | +* `README.md` — new “Client Demo (Pulse)” section covering login flow, Studio usage, and hidden-token behavior. |
| 529 | + |
| 530 | +--- |
| 531 | + |
| 532 | +### **Verification** |
| 533 | + |
| 534 | +* Manually exercised the login form against a local MetaDetect backend: |
| 535 | + * Verified successful `/auth/login` response, token persistence to `localStorage`, and automatic redirect to `compose.html`. |
| 536 | +* From Pulse Studio: |
| 537 | + * Uploaded sample images through `/api/images/upload`, confirmed captions/labels persisted via `/api/images/{id}` `PUT`. |
| 538 | + * Validated feed refresh hits `/api/images` and that signed URLs render in cards via `/api/images/{id}/url`. |
| 539 | + * Deleted posts with `/api/images/{id}` `DELETE` and confirmed feed updates. |
| 540 | +* README instructions were followed start-to-finish (serve with `python3 -m http.server 4173 --directory client`) to ensure documentation accuracy. |
| 541 | + |
| 542 | +--- |
| 543 | + |
| 544 | +### **Attribution Statement** |
| 545 | + |
| 546 | +> The Pulse demo client (login UI, Pulse Studio composer, token automation, and related documentation) was developed with assistance from **OpenAI ChatGPT (GPT-5)** on November 10, 2025. All generated assets were reviewed, manually tested in the browser, and incorporated into commit `feat(Init): Demo UI Setup Initi (#49)` by the project team. |
| 547 | +
|
| 548 | +--- |
| 549 | + |
| 550 | +### **Commit / Ticket Reference** |
| 551 | + |
349 | 552 | * **Commit:** `feat(security): enable JWT resource server and implement identity resolution from Supabase tokens (refs #10)` |
350 | 553 | * **Ticket:** `#10 — Service: Implement UserService core logic (Iteration 1)` |
351 | 554 | * **Date:** February 27, 2025 |
|
0 commit comments