
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
In the Cartesian coordinate system $xOy$, the parametric equation of curve $C$ is $\begin{cases} x=1+4\cos \theta \\ y=-1+4\sin \theta \end{cases}$ (where $\theta$ is the parameter), in the polar coordinate system with $O$ as the pole and the positive half-axis of $x$ as the polar axis, the equation of line $l$ is $\rho= \frac{2 \sqrt{2}m}{\sin (\theta+ \frac{\pi}{4})}$ (where $m$ is a constant).  
$(1)$ Find the general equation of curve $C$ and the Cartesian equation of line $l$;  
$(2)$ If line $l$ intersects curve $C$ at points $A$ and $B$, when $|AB|=4$, find the value of the real number $m$.

Present the answer in LaTex format: \boxed{Your answer}
user