Use single Cora-For-Human folder for all xlsx reads

All handlers (BLM, content, OPT) now read Cora xlsx from one shared
folder (//PennQnap1/SHARE1/Cora-For-Human). Files stay in place after
processing so multiple task types can share the same report.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
clickup-runner
PeninsulaInd 2026-04-09 15:46:43 -05:00
parent f4e642240c
commit d2b59bb5e6
4 changed files with 31 additions and 75 deletions

View File

@ -91,9 +91,13 @@ clickup:
autocora:
jobs_dir: "//PennQnap1/SHARE1/AutoCora/jobs"
results_dir: "//PennQnap1/SHARE1/AutoCora/results"
xlsx_dir: "//PennQnap1/SHARE1/Cora72-for-macro"
xlsx_dir: "//PennQnap1/SHARE1/Cora-For-Human"
poll_interval_seconds: 120
blm:
blm_dir: "E:/dev/Big-Link-Man"
timeout_seconds: 1800
nas:
generated_dir: "//PennQnap1/SHARE1/generated"
@ -241,6 +245,28 @@ At the start of each cycle, the runner scans the results directory:
If a task at `run_cora` stage already has an `.xlsx` attachment, the runner
skips Cora submission and advances directly to the next stage.
## BLM Handler (Link Building build stage)
The Link Building `build` stage runs Big-Link-Man directly -- no Claude needed.
1. Sets status to "AI Working"
2. Looks for a Cora `.xlsx` in `//PennQnap1/SHARE1/Cora-For-Human/` matching the task keyword
3. Runs `ingest-cora` via BLM's own venv Python (`E:/dev/Big-Link-Man/.venv/Scripts/python.exe`)
4. Runs `generate-batch` with `--continue-on-error`
5. On success: advances Stage to `final`, posts summary comment, unchecks Delegate to Claude
6. On failure: sets Error checkbox, posts structured error comment
BLM credentials are injected from `BLM_USERNAME` and `BLM_PASSWORD` env vars.
## Cora .xlsx Files
All Cora reports live in **one folder**: `//PennQnap1/SHARE1/Cora-For-Human/`
- AutoCora drops finished reports here
- All handlers (BLM, content, OPT) read from this folder by keyword match
- Files are **not moved** after processing -- they stay in place so multiple task types can use the same report
- A separate cleanup script can move old files to `processed/` when no open tasks match the keyword
## Logs
- Console output: INFO level

View File

@ -464,14 +464,14 @@ def _dispatch_blm(
client.update_task_status(task.id, cfg.clickup.ai_working_status)
# 2. Find the Cora xlsx
xlsx_path = find_cora_xlsx(keyword, cfg.blm.cora_inbox)
xlsx_path = find_cora_xlsx(keyword, cfg.autocora.xlsx_dir)
if not xlsx_path:
_handle_dispatch_error(
client, cfg, db, task, run_id,
error="No Cora xlsx found for keyword '%s' in %s"
% (keyword, cfg.blm.cora_inbox),
% (keyword, cfg.autocora.xlsx_dir),
fix="Check that the Cora report exists in %s, then re-check Delegate to Claude."
% cfg.blm.cora_inbox,
% cfg.autocora.xlsx_dir,
)
return

View File

@ -36,14 +36,13 @@ class ClickUpConfig:
class AutoCoraConfig:
jobs_dir: str = "//PennQnap1/SHARE1/AutoCora/jobs"
results_dir: str = "//PennQnap1/SHARE1/AutoCora/results"
xlsx_dir: str = "//PennQnap1/SHARE1/Cora72-for-macro"
xlsx_dir: str = "//PennQnap1/SHARE1/Cora-For-Human"
poll_interval_seconds: int = 120
@dataclass
class BLMConfig:
blm_dir: str = "E:/dev/Big-Link-Man"
cora_inbox: str = "//PennQnap1/SHARE1/cora-inbox"
timeout_seconds: int = 1800 # 30 minutes

View File

@ -1,69 +0,0 @@
# Link Building -- Build Stage
Run the Big-Link-Man (BLM) CLI to ingest a Cora report and generate tiered backlink content.
## What You Have
- A Cora `.xlsx` report on the NAS at `//PennQnap1/SHARE1/Cora72-for-macro/`
- The task's keyword, target URL, and optional CLI flags in the Task Context below
## Steps
### 1. Find the Cora .xlsx File
Search `//PennQnap1/SHARE1/Cora72-for-macro/` for a file matching the task keyword. The filename is a slugified version of the keyword (e.g., "gearbox oil sight glass" -> `gearbox_oil_sight_glass.xlsx`). Use glob/ls to find it. If multiple matches exist, pick the most recent.
### 2. Run ingest-cora
Run the BLM CLI using its own venv Python (NOT the system Python or CheddahBot's venv):
```bash
E:/dev/Big-Link-Man/.venv/Scripts/python.exe main.py ingest-cora \
-f "<path_to_xlsx>" \
-n "<keyword>" \
-m "<target_url>" \
<additional_cli_flags>
```
- Working directory: `E:/dev/Big-Link-Man`
- Always pass `-m` with the target URL (prevents interactive prompts)
- If BrandedPlusRatio is provided and not 0.7, add `-bp <value>`
- If CustomAnchors is provided, add `-a "<anchors>"`
- If CLIFlags is provided, append them as-is (e.g. `--tier1-count 6`)
- BLM credentials are in env vars `BLM_USERNAME` and `BLM_PASSWORD` -- pass them as `-u` and `-p`
**Expected output:** Look for lines like:
- `Success: Project 'name' created (ID: 42)`
- `Job file created: jobs/some-file.json`
If exit code is non-zero, stop and report the error including stdout and stderr.
### 3. Run generate-batch
Using the job file path from step 2:
```bash
E:/dev/Big-Link-Man/.venv/Scripts/python.exe main.py generate-batch \
-j "<job_file_path>" \
--continue-on-error
```
- Working directory: `E:/dev/Big-Link-Man`
- Always include `--continue-on-error`
- Pass `-u` and `-p` credentials from env vars
- This step can take several minutes
If exit code is non-zero, stop and report the error.
### 4. Collect Output
After generate-batch completes, the generated content files are in Big-Link-Man's output directory. Copy the relevant output files to the current working directory so they get uploaded to ClickUp.
Look in `E:/dev/Big-Link-Man/output/` for the project folder matching the keyword. Copy all `.md`, `.txt`, and `.html` files from there to the current working directory.
## Important
- NEVER use `uv run` or CheddahBot's Python -- always use BLM's venv at `E:/dev/Big-Link-Man/.venv/Scripts/python.exe`
- If the venv doesn't exist, stop and report the error
- Do not modify any BLM source code
- Do not create subdirectories in the working directory